For more information about dialog boxes, see http://www-10.lotus.com/ldd/lfwiki.nsf/xpDocViewer.xsp?lookupName=Webform+Server+8+documentation#action=openDocument&res_title=Modal_Dialog_box_WFS_8&content=pdcontent
By default, the modal dialog will be centered (both vertically & horizontally) within the middle of the window that contains the form. Normally this is fine but in some scenarios, this default behaviour causes the dialog to appear off screen or not centered within the top level window. Some of these problem scenarios include long forms and forms embedded in other applications (Portal, BusinessSpace, ICM etc).
var currentNode = window.frameElement.parentNode;
// in future releases of IBM Forms, the id being searched for (wsDijit_ibm_WSIFrameDialog_) may change
// an alternateive way of finding the <div> would be to use dojo/query
if (currentNode.id && (currentNode.id.indexOf('wsDijit_ibm_WSIFrameDialog_') == 0))
//currentNode.style.left = '10px';
currentNode.style.top = '10px';
currentNode = currentNode.parentNode;
This sample works with IBM Forms 126.96.36.199 in FireFox 10 and Internet Explorer 8 but other versions and browsers have not been tested.
This sample relies on a HTML DOM structure that might change in future releases/versions. If the DOM structure changes, this sample may no longer work but users should be able to easily update the sample themselves to match any changes.
If you are going to use the sample on your own system, you will have to save the html file to a location on your web server and then update the form to use the new url.
Example 1: a dialog box in a long form rendered within ICM using the default position.
Example 2: the same page with the modal dialog re-positioned to the top of the page.