mwf.xdesktop.requireapp("process.xform", "$module", null, false);
/** @class button 按钮组件。
* @o2cn 按钮
* @example
* //可以在脚本中获取该组件
* //方法1:
* var button = this.form.get("name"); //获取组件
* //方法2
* var button = this.target; //在组件事件脚本中获取
* @extends mwf.xapplication.process.xform.$module
* @o2category formcomponents
* @o2range {process|cms|portal}
* @hideconstructor
*/
mwf.xapplication.process.xform.button = mwf.appbutton = new class({
implements: [events],
extends: mwf.app$module,
iconstyle: "personfieldicon",
_loaduserinterface: function(){
// var button = new element("button");
// button.inject(this.node, "after");
// this.node.destroy();
// this.node = button;
var button = this.node.getelement("button");
if (!button) button = new element("button");
button.inject(this.node, "after");
this.node.destroy();
this.node = button;
this.node.set({
"id": this.json.id,
"text": this.json.name || this.json.id,
"mwftype": this.json.type
});
if (!this.json.preprocessing) this.node.setstyles(this.form.css.buttonstyles);
if( this.json.properties ){
this.node.set(this.json.properties )
}
}
});
source