text: /**** efw3.X Copyright 2016 efwGrp ****/
  /**
   * The class as event result.
   * 
   * @author Chang Kejun
   */
  function Result() {
  	this.actions = {};
  	this.values = [];
  };
  
  /**
   * The array to keep action values.
   */
  Result.prototype.actions = null;
  /**
   * The array to keep return values.
   */
  Result.prototype.values = null;
  /**
   * The function to add one return value in the result.<br>
   * And create runat attribute to it.
   * 
   * @param {String}
   *            selector: optional<br>
   * @returns {Result}
   */
  Result.prototype.runat = function(selector) {
  	var ret = {};
  	ret.runat = selector;
  	this.values.push(ret);
  	return this;
  };
  /**
   * The function to create remove attribute to last return value.
   * 
   * @param {String}
   *            selector: required<br>
   * @returns {Result}
   */
  Result.prototype.remove = function(selector) {
  	if (this.values.length > 0) {
  		var ret = this.values[this.values.length - 1];
  		if (ret.remove==null) ret.remove = selector;
  	}
  	return this;
  };
  /**
   * The function to create append attribute to last return value.
   * 
   * @param {String}
   *            mask: required<br>
   * @returns {Result}
   */
  Result.prototype.append = function(mask) {
  	if (this.values.length > 0) {
  		var ret = this.values[this.values.length - 1];
  		if (ret.append==null) ret.append = mask;
  	}
  	return this;
  };
  /**
   * The function to create widthdata attribute to last return value.
   * 
   * @param {Array |
   *            Object} data: required<br>
   * @returns {Result}
   */
  Result.prototype.withdata = function(data) {
  	if (this.values.length > 0) {
  		var ret = this.values[this.values.length - 1];
  		if (ret.withdata==null) ret.withdata = data;
  	}
  	return this;
  };
  /**
   * The function to concatenate to another result.
   * 
   * @param {Result} result: required<br>
   * @returns {Result}
   */
  Result.prototype.concat = function(result) {
  	if(result){
  		if(result.values){
  			this.values = this.values.concat(result.values);
  		}
  		if(result.actions){
  			if (result.actions.show)this.show(result.actions.show);
  			if (result.actions.hide)this.hide(result.actions.hide);
  			if (result.actions.disable)this.disable(result.actions.disable);
  			if (result.actions.enable)this.enable(result.actions.enable);
  			if (result.actions.navigate)this.navigate(result.actions.navigate.url, result.actions.navigate.params);
  			if (result.actions.download){
  				if (result.actions.download.zip)this.attach(result.actions.download.zip,result.actions.download.zipBasePath);
  				if (result.actions.download.file)this.attach(result.actions.download.file,result.actions.download.zipBasePath);
  				if (result.actions.download.deleteafterdownload)this.deleteAfterDownload();
  			}
  			if (result.actions.alert)this.alert(result.actions.alert);
  			if (result.actions.highlight)this.highlight(result.actions.highlight);
  			if (result.actions.focus)this.focus(result.actions.focus);
  			if (result.actions.error)this.error(result.actions.error.clientMessageId,result.actions.error.params);
  			if (result.actions.confirm)this.confirm(result.actions.confirm.message, result.actions.confirm.buttons);
  			if (result.actions.eval)this.eval(result.actions.eval);
  			
  		}		
  	}
  	return this;
  };
  
  
  /**
   * The function to show elements in client.
   * 
   * @param {String}
   *            selector: required<br>
   * @returns {Result}
   */
  Result.prototype.show = function(selector) {
  	if (this.actions.show==null){
  		this.actions.show=selector;
  	}else{
  		this.actions.show+=","+selector;
  	}
  	return this;
  };
  /**
   * The function to hide elements in client.
   * 
   * @param {String}
   *            selector: required<br>
   * @returns {Result}
   */
  Result.prototype.hide = function(selector) {
  	if (this.actions.hide==null){
  		this.actions.hide=selector;
  	}else{
  		this.actions.hide+=","+selector;
  	}
  	return this;
  };
  /**
   * The function to disable elements in client.
   * 
   * @param {String}
   *            selector: required<br>
   * @returns {Result}
   */
  Result.prototype.disable = function(selector) {
  	if (this.actions.disable==null){
  		this.actions.disable=selector;
  	}else{
  		this.actions.disable+=","+selector;
  	}
  	return this;
  };
  /**
   * The function to enable elements in client.
   * 
   * @param {String}
   *            selector: required<br>
   * @returns {Result}
   */
  Result.prototype.enable = function(selector) {
  	if (this.actions.enable==null){
  		this.actions.enable=selector;
  	}else{
  		this.actions.enable+=","+selector;
  	}
  	return this;
  };
  /**
   * The function to navigate to another page in client.
   * 
   * @param {String}
   *            url: required<br>
   * @param {Object}
   *            params: optional<br>
   * @returns {Result}
   */
  Result.prototype.navigate = function(url,params) {
  	if(!this.actions.navigate){
  		this.actions.navigate={};
  		this.actions.navigate.url=url;
  		this.actions.navigate.params=params;
  	}
  	return this;
  };
  /**
   * The function to set download file or folder path.
   * 
   * @param {String |
   *            Array} path: required<br>
   * @param {String} zipBasePath: optional<br>
   * @returns {Result}
   */
  Result.prototype.attach = function(path,zipBasePath) {
  	if (!this.actions.download)this.actions.download={};
  	if (zipBasePath!=null){
  		this.actions.download.zipBasePath=zipBasePath;
  	}
  	if (this.actions.download.zip != null) {
  		if (path instanceof Array) {
  			this.actions.download.zip = this.actions.download.zip.concat(path);
  		} else {
  			this.actions.download.zip.push(path);
  		}
  	} else if (this.actions.download.file != null) {
  		this.actions.download.zip = [];
  		this.actions.download.zip.push(this.actions.download.file);
  		if (path instanceof Array) {
  			this.actions.download.zip = this.actions.download.zip.concat(path);
  		} else {
  			this.actions.download.zip.push(path);
  		}
  		delete this.actions.download.file;
  	} else {
  		if (path instanceof Array) {
  			this.actions.download.zip = [];
  			this.actions.download.zip = this.actions.download.zip.concat(path);
  		} else if (EfwServerFile.prototype.isFolder(path)) {
  			this.actions.download.zip = [];
  			this.actions.download.zip = this.actions.download.zip.concat(path);
  		} else {
  			this.actions.download.file = path;
  		}
  	}
  	return this;
  };
  /**
   * The function to set the file name for saving .
   * 
   * @param {String} filename: required<br>
   * @returns {Result}
   */
  Result.prototype.saveas = function(filename) {
  	if (!this.actions.download)this.actions.download={};
  	this.actions.download.saveas=filename;
  	return this;
  };
  
  /**
   * The function to set a flag to delete original files after download.
   * 
   * @returns {Result}
   */
  Result.prototype.deleteAfterDownload = function() {
  	if (this.actions.download)	this.actions.download.deleteafterdownload = true;
  	return this;
  };
  /**
   * The function to show alert in client.
   * 
   * @param {String |
   *            Array} message: required<br>
   * @param {Object}
   *            params: optional<br>
   * @returns {Result}
   */
  Result.prototype.alert = function(message, params) {
  	if (!this.actions.alert)
  		this.actions.alert = [];
  	if (message instanceof Array) {
  		this.actions.alert = this.actions.alert.concat(message);
  	} else {
  		for(var key in params){
  			if (key=="debug") continue;// debug function is skipped
  			message=message.replace(new RegExp("{"+key+"}", "g"), params[key]);
  		}
  		this.actions.alert.push(message);
  	}
  	return this;
  };
  /**
   * The function to highlight error elements.
   * 
   * @param {String}
   *            selector: required<br>
   * @returns {Result}
   */
  Result.prototype.highlight = function(selector) {
  	if (this.actions.highlight==null){
  		this.actions.highlight=selector;
  	}else{
  		this.actions.highlight+=","+selector;
  	}
  	return this;
  };
  /**
   * The function to set focus to an element.
   * 
   * @param {String}
   *            selector: required<br>
   * @returns {Result}
   */
  Result.prototype.focus = function(selector) {
  	if (!this.actions.focus)this.actions.focus=selector;
  	return this;
  };
  /**
   * The function to error.
   * 
   * @param {String}
   *            clientMessageId: required<br>
   * @param {Object}
   *            params: optional<br>
   * @returns {Result}
   */
  Result.prototype.error = function(clientMessageId,params) {
  	if (!this.actions.error)
  		this.actions.error = {"clientMessageId":clientMessageId,"params":params};
  	return this;
  };
  /**
   * The function to confirm.
   * 
   * @param {String}
   *            message: required<br>
   * @param {Object}
   *            buttons: required<br>
   * @param {Object}
   *            params: optional<br>
   * @returns {Result}
   */
  Result.prototype.confirm = function(message, buttons, params) {
  	if (!this.actions.confirm) {
  		for ( var key in params) {
  			if (key=="debug") continue;// debug function is skipped
  			message = message.replace(new RegExp("{" + key + "}", "g"),
  					params[key]);
  		}
  		this.actions.confirm = {
  			"message" : message,
  			"buttons" : buttons
  		};
  	}
  	return this;
  };
  /**
   * The function to execute script.
   * @param {String} script: required<br>
   * @returns {Result}
   */
  Result.prototype.eval = function(script){
  	if (!this.actions.eval) this.actions.eval=[];
  	if (script instanceof Array) {
  		this.actions.eval = this.actions.eval.concat(script);
  	}else{
  		this.actions.eval.push(script);
  	}
  	return this;
  };
  