This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jul 12, 2011, 10:27 AM
2 Posts
topic has been resolvedResolved

Dojo Dialog problem after refresh

  • Category: Dojo and Client Side JavaScript
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 2
Hi, I've created a dialog box following the notes in:
http://xpagesblog.com/xpages-blog/2010/4/10/xpages-compatible-dojo-dialog-reusable-component.html
and it works well until no full refresh is call on the page.

The button that show the dialog should set a label value in the dialog prior showing it; I use this code:

var inputNode4 = dojo.query('[id$="lblNome"]');
if(inputNode4!=null && inputNode4.length>0) {
  inputNode4[inputNode4.length-1].innerHTML = value;
}

This works when xpage is first loaded, but when page if full refreshed it don't works anymore.

Have you any clues?
Thanks in advance
Jul 12, 2011, 4:10 PM
64 Posts
Re: Dojo Dialog problem after refresh
- Try doing this in onload, if you aren't.  Either:
 
dojo.addOnLoad(function() { your code });  or XSP.addOnLoad(function() { your code });
Jul 14, 2011, 8:36 AM
2 Posts
Re: Dojo Dialog problem after refresh

Thanks for suggestion.
I've noted that when the page is first loaded the length property of node is 2, but after full refresh is 1.

var inputNode4 = dojo.query('[id$="lblNome"]');
if(inputNode4!=null && inputNode4.length>0) {
  inputNode4[inputNode4.length-1].innerHTML = value;
}

The script works only when length=2.


So I've added:

XSP.addOnLoad(function() { code });

with this code:

var mynode = dojo.query('[id$="lblNome"]');
if(mynode!=null && mynode.length!=2) {
  var frame = dojo.query('[id$="frame"]');
  if(frame!=null && frame.length>0)
    XSP.partialRefreshGet(frame[0].id);
}

note: 'frame' is the main panel which include all controls.

Now this works! Thank you!


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal