style:comboBoxSelectObject.style,
invalidMessage:this._getNLSMessage
(comboBoxSelectObject.invalidMessage),
promptMessage:this._getNLSMessage
(comboBoxSelectObject.promptMessage)
};
this.comboBox=newdijit.form.ComboBox(props,
this._getDivElement(comboBoxSelectObject));
this.comboBox._setClassAttr
(this._getObjectClass
(comboBoxSelectObject.cssclass,
comboBoxSelectObject.style));
this.comboBox.setValue(comboBoxSelectObject.value);
this._configureScriptHitch(this.comboBox,comboBoxSelectObject);
this.objectsList.add(this.objectsList.count,this.comboBox);
console.debug("Trace:"+"Class:"+this.CLASSNAME+"Function:"+
FUNCTIONNAME+"-Action:Exit");
}
在本文附带的 DojoMarkupHandler.js 文件中提供了为其他 DOJO 类型(文本框、复选框、日期文本框、按钮、多选框和文本区域)生成 markup 的源代码。
在 configureScriptHitch 方法中,把脚本方法与组件连接起来,见清单 4。
清单 4. configureScriptHitch 方法
configureScriptHitch:function(){
if(itemObj.scriptmethod)
{
if(this.thisVar.iContext.getElementById
(this.widgetId+itemObj.id)!=null){
elementId=this.thisVar.iContext.getElementById
(this.widgetId+itemObj.id);
}else{
elementId=dojo.byId(this.widgetId+itemObj.id);
}
varscriptKeys=itemObj.scriptmethod.split(":");
vareventType=scriptKeys[0];
varscriptName=scriptKeys[1];
if(itemObjId==null)
{
dojo.connect(elementId,eventType,dojo.hitch(this.scriptMethodObj,scriptName));
}else{
dojo.connect(itemObjId,eventType,dojo.hitch(this.scriptMethodObj,scriptName));
}
}
如何在代码中使用 markup 处理程序
本节讲解如何在自己的代码中调用 markup 处理程序 JavaScript 类。
在 JSON 文件中定义属性。需要在 JSON 文件(例如 markuphandler.json)中定义屏幕上所有小部件的属性,见下面的 JSON 文件片段。一定要指定每个小部件的必有属性,根据需要添加可选属性。
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-51839-4.html
马云也是拼了啊
至少七个
不要一天都在自己近海训练