我正在使用ecm.widget.dialog.ConfirmationDialog
并添加了一个dijit/SimpleTextArea
。单击“是”按钮时,我正在检查用户是否在 中输入了值textarea
,如果没有,我想向用户显示一条消息并留在confirmationDialog
. 它显示消息,但事件被触发并且流程继续。我什至试图通过
dojo.stopEvent(evt);
但它不起作用。有人可以帮助我如何停止该事件,以便在用户输入值之前保留对话框?
下面是代码片段
this.msgDialogBox = new ConfirmationDialog();
var textarea = new SimpleTextarea({
rows: "4",
cols: "50",
placeHolder:"Please provide reject reason",
maxLength:"256",
style:"width: 95%; height: 90px;",
required:true
},domConstruct.create("div",{align:'center'},this.msgDialogBox.contentArea));
textarea.startup();
on(this.msgDialogBox,"Execute",function(evt){
if(!textarea.get("value")){
domConstruct.place(domConstruct.create("div",{align:'center',innerHTML:'Reject reason cannot be blank',style:'color:#ff0000'}),this.inlineMessage,"after");
dojo.stopEvent(evt);
}else{
//value is there so perform task
}
});