On the web, we are trying to have a document open up in a dojo dijit dialog box in edit mode. This was an easy enough task in read mode but it has proven to be more difficult in edit mode.
We can get the document to open in edit mode but none of the buttons do anything when clicked. We’ve even tried to put a simple client side alert and that doesn’t fire.
We’ve searched in here and saw that others have had similar problems but their posts went unanswered. On the dojo support site we also saw references to focus issues that are supposed to be fixed in 1.5 - not sure if that is part of the problem or not.
Here is the code as it sits in a data column. We have a custom control that sits in a div and that opens just fine. Once again, the problem is that none of the buttons in this CC do anything when opened up in the dijit box.
dojo.require(“dijit.Dialog”);
dojo.require(“dijit.form.Button”);
dojo.addOnLoad(function(){
//first check if it's there so we don't create a duplicate
var dialog = dijit.byId('dialogId');
if (dialog) { dialog.destroyRecursive(); }
// create a "hidden" Dialog till calling show it
var dialog = new dijit.Dialog({
title:"Field Profile",
id: "dialogId",
refreshOnShow: true,
preventCache: true
});
dojo.connect(dijit.byId("btnDemiss"), "onClick", dialog, "show");
// this function creates the dialog box and moves its content inside the form tag.
var xdialog = dojo.byId("dialogId");
xdialog.parentNode.removeChild(xdialog);
var form = document.forms[0];
form.appendChild(xdialog);
dialog.startup();
var url = "xpFormFieldProfile.xsp" + "?documentId=" + "#{javascript:rowFieldProfile.getUniversalID()}" + "&action=openDocument";
dialog.attr("href", url);
// showe the dialog box
dialog.show();
});
Subject: XPages dijit dialog
Various bloggers have identified the root cause being the dijit dialog getting moved outside the Form tag when it’s created. The ‘conversation’ has extended through a number of blog posts, so you probably won’t find responses to individual queries here because they tend to be specific. Also, the latest work is on two main XPages resource, the Domino Designer Wiki and The XPages Blog - if you’re not already looking at those as a matter of course, it’s worth doing so.
As Julian Buss notes, the result is that without additional work you can’t use SSJS or call a partial refresh on a button in a dijit dialog, or it won’t work (http://www.youatnotes.de/web/youatnotes/blog2.nsf/dx/xpages-display-a-panel-as-nice-dojodijit-dialog-on-page-load.htm).
Mark Hughes showed an example of a picklist dijit dialog working by moving the dialog back inside the form tag, which he posted on the Domino Designer wiki. http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Create_a_Picklist_View_in_X-Pages
What looks to be the best option if you’re editing forms is Jeremy Hodge’s post on the XPages blog サッカー ユニフォーム 安い – xpagesblog.com | 安いジャージを買う。 21.99 という安いジャージ。 ファンに最高のコレクションを提供します。 安心してお買い物をしてください。. This is the most recent and probably complete resolution.
Subject: re
Thank you SO much for laying that all out Paul. We had done a ton of research but I think we may have missed the last solution. We have seen various methods for doing this but we did not want to pass in fields as parameters or anything like that.
Just so I understand you, it looks like the most recent solution will allow me to pass in a url or node for editing using this custom box?
Subject: re:dialog
If I understand Jeremy’s method correctly, I think that you code you dialog in the same way as normal, either using a
tag or the new function in client-side javascript, but instead of using dijit.Dialog as the dojo type, you use the new ‘com.ZetaOne.widget.Dialog’ dojo type. This extends the dijit.Dialog to ensure your dialog is always placed within the Form tag, which means the buttons work, if I understand it correctly.
Subject: Open an xpages to dijit.Dialog
Opening a dijit dialog from
markup is working perfectly but not from programatically through a javascript function. We are trying to open/edit document in dijit dialog by clicking on an icon in the view column from viewpanel. The dialog is displaying document perfectly but all buttons are idle and no action fire. Here is the code:
dojo.require(“dijit.form.Button”);
dojo.addOnLoad(function(){
//first check if it's there so we don't create a duplicate
var dialog = dijit.byId("fieldProfileDialogId");
if (dialog) { dialog.destroyRecursive(); }
var url = "xpFormFieldProfile.xsp" + "?documentId=" + "#{javascript:rowFieldProfile.getUniversalID()}" + "&action=editDocument";
// create a "hidden" Dialog till calling show it
var dialog = new Com.ZetaOne.widget.Dialog({
title:"Field Profile",
href: url,
refreshOnShow: true,
preventCache: true
},
dojo.byId("fieldProfileDialogId")
);
// showe the dialog box
dialog.show();
});
Please note that we are opening an xpages in a dijit diaolog box.
Thanks a lot.