Subject: I’m still a no-go at this station…
- First off, I greatly appreciate your time and effort, Judy. One would think with all that input I could make this work. Sadly I have not.
My button to show the dialog looks like this:
<xp:button value=“eDocs Comment” id=“Comment” title=“Upload a comment to eDocs” icon=“/actn130.gif” styleClass=“actionBarBtn”>
<xp:eventHandler event="onclick">
<xp:this.script><![CDATA[
dijit.byId(‘#{id:dlgWFNote}’).show();
]]></xp:this.script>
</xp:eventHandler>
</xp:button>
I changed it based on your example. Originally it had:
return showMe(‘#{id:dlgWFNote}’, ‘Upload eDocs Comment’);
as the script. When I changed it to remove the return, the dialog was no longer “modal”, in that it would not wait for user input. It presented, stayed about a second, then auto-dismissed. If I’m real quick I can type something and click a button, but no matter what I do, the result is the same.
- The custom control containing the dialog looks like this:
xp:this.resources
<xp:dojoModule name="dijit.Dialog" />
<xp:dojoModule name="dijit.form.Textarea" />
<xp:dojoModule name="dijit.form.Button" />
</xp:this.resources>
<xp:div id=“dlgWFNote” dojoType=“dijit.Dialog” style=“display:none;width:50%” title=“Upload comment”>
<xp:text value="Enter comment to be uploaded to eDocs:" style="display:block" />
<xp:inputTextarea id="dlgWFComment" value="#{Ticket.Comments}" style="min-height:10em;display:block;width:95%" />
<div style="text-align:center">
<xp:button dojoType="dijit.form.Button" id="btnWFSend" value=" Add Comment" type="submit" icon="/actn010.gif">
<xp:eventHandler event="onClick" submit="true" immediate="false" save="false" id="Accept" refreshMode="complete">
<xp:this.action>
<xp:saveDocument />
</xp:this.action>
<xp:this.script><![CDATA[
var xpAct=dojo.byId(“#{id:xpAction}”);
xpAct.value=“WFN:”+dojo.byId(“#{id:dlgWFComment}”).value+“]”;
alert(“xpAction: "”+xpAct.value+“"”);
dijit.byId(‘#{id:dlgWFNote}’).hide();
return true;
]]></xp:this.script>
</xp:eventHandler>
</xp:button>
 - 
<xp:button dojoType="dijit.form.Button" id="btnWFCancel" value=" Cancel" type="button" onclick="dijit.byId('#{id:dlgWFNote}').hide();" icon="/actn011.gif" />
</div>
</xp:div>
xp:scriptBlock
<xp:this.value escape="false"><![CDATA[
dialog_create(“#{id:dlgWFNote}”, “Upload comment”);
]]></xp:this.value>
</xp:scriptBlock>
I added the dialog_create() at the bottom because you have it. If I put dojo.addOnLoad(dialog_create()) in the script block I get an error, but this straight dialog_create() seems to work. After putting that in, it did start running the CSJS (as indicated by the alert popping), and it does trigger some server-side activity, but only an afterRestoreView. It will not actually save, or run any save events on the data source.
I have tried every variation of immediate, save, and submit. The most I can get it to do is run afterRestoreView.
-
I do not have a data source associated with any dialog. There is only the data source on the XPage that the dialogs are on, which is named “Ticket”.
-
Here’s dialog_create() and show_me(), in an included client-side library:
function dialog_create(id, title1) {
var dialogWidget=dijit.byId(id);
if(dialogWidget && dialogWidget.destroyRecursive) dialogWidget.destroyRecursive(false);
dialogWidget=new dijit.Dialog(
{title: title1},
dojo.byId(id)
);
var dialog=dojo.byId(id);
dialog.parentNode.removeChild(dialog);
var form=document.forms[0];
form.appendChild(dialog);
dialogWidget.startup();
return dialogWidget;
}
/* Display a dijit dialog based on a Custom Control, creating it if necessary
Based on a R8.5 Notes.net forum post by Lothar Mueller, and dijit web research
*/
function showMe(dlgName, dlgTitle) {
var dlg=dijit.byId(dlgName);
if(dlg) dlg.show();
else {
dlg=dialog_create(dlgName, dlgTitle);
if(dlg) dlg.show();
else {
alert(dlgName+" explicit create failed");
return false;
}
}
return true;
}
Previously I had this code at the bottom starting from the line “var dialog=…”
dojo.body().appendChild(dialogWidget.domNode);
dialogWidget.startup();
return dialogWidget;
which is based on xpagesblog dialog samples.
-
If I put the showMe() call back, it’s being typcially flakey. Before I replaced “return showMe(…)” with “dijit.byId(…).show()”, it would wait for user input. Now that I’ve put “return showMe()” back, it will no longer wiat for input. No matter what I do, it pops the dijit dialog and immediately dismisses it. Period. The only line I changed is the button to invoke the dialog, yet it’s behaving differently. This is the story of my entire XPages experience. Disastrous inconsistency.
-
The dialogs are all what should be painfully trivial things, like requesting some input and saving the document. In R-prior this would have taken minutes to build a Form, present it in a pop-up, and do a document.sumbit() to trigger WebQuerySave. Minutes.
I’d appreciate any input at all. Meantime I’m going to try the hokey pop-up window method. I’ve squandered so much time on what should be a cake walk that it’s not even remotely funny…