Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript, dojo, building dialogs in jsp's with enclosures
    primarykey
    data
    text
    <p>I am using closures in dojo dialogs to keep functions and variables from colliding.</p> <p>I have a jsp page that includes a complex dialog. It is mostly working. Just one really annoying detail. if the widget changes how do I notify a handler method? we want as much of the java script for the dialog to be kept within the closure.</p> <p>Since the popup appears in multiple locations I want future programmers to be able to replace myVar with anything. Is there a way to determine what to correctly put in the onChange</p> <p>------jsp page-----<br/> <CODE> var myVar = new MyNewPopupStuff(42);<br/> myVar.contstrucDialog();<br/> ......<br> includeTemplate template="myDialog.jsp"<br/> .....<br/></p> <p>--------myDialog.jsp----<br/> <CODE> &lt; script type="text/javascript" src="my.js"/></p> <p>.....<br/></p> <p>&lt; div id="myDialogData" dojotype="dijit.layout.ContentPane" region="right" splitter="true" class="data" style=" width:50%; " > &lt;\/div><br/> ....<br/></p> <p></CODE> --------my.js file----<br/></p> <pre>function MyNewPopupStuff(param){ this.contstrucDialog = function() ....... while( more widgets to add){ fieldHolder=dojo.byId("myDialogData" addWidget(widgetName,myDialogData); } addWidget = function(fieldHolder, widgetName){ // need to print the name of the variable in "myVar.bar()" (myVar or what ever it may be) dojo.place(newLabel, fieldHolder); var newField = new dijit.form.ValidationTextBox({ id: "i"+contactTypeId, name: widgetName, value: value, trim: true, **onChange:**??????when the widget is mofied I want to call the below modifyOnChange not some other modify on change I think I want something like myVar.modifyOnChange???? }); } this.modifyOnChange = function() { alert("modified"); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload