Stop event of ecm.widget.dialog.ConfirmationDialog

I’m using ecm.widget.dialog.ConfirmationDialog and have added a dijit/SimpleTextArea to it. On click of Yes button, I’m checking if there is a value entered by a user in the textarea and if not, I want to show a message to user and stay on the confirmationDialog. It shows the message but event is getting fired and flow continues. I even tried to stop the event by

dojo.stopEvent(evt)
but it doesn’t work. Can someone help me on how to stop that event so that dialog is retained until the user enters a value?

Below is the code snippet

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
}

});

Related:

Leave a Reply