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



Feb 20, 2012, 6:10 AM
7 Posts
topic has been resolvedResolved

window.open & window.opener 's problem

  • Category: Dojo and Client Side JavaScript
  • Platform: Windows
  • Release: 8.5.1
  • Role: Developer
  • Tags:
  • Replies: 1
I want to know how to change the parentwindow's field value at children window.  how to use window.opener in xpages.     8.5.1
 
example:
 
if (window.opener && !window.opener.closed) {

    alert(window.opener.document.URL);      // it is ok.   I can get parent window 's url
    
    alert(window.opener.document.getElementById("#{id:inputText3}").value)           // i can't get parentwindow filed value
   
    window.opener.document.getElementById("#{id:inputText3}").text="111";     // i can't input the value for parentwindow.
   
}
 
thanks.    
 
Feb 20, 2012, 3:12 PM
30 Posts
Re: window.open & window.opener 's problem
There's no way for the parser to know about the fields you're referring to from another page.
 
What you could do is to either send the ID:s along with the function that opens the new window.
Depending on your situation: 
 
If the new page also is an XPage: as a  Requestscope variable.
Or in the URL and then extract them from there, or place the ID:s in a cookie or not open a new window at all! Open a Dojo dialog instead, then you'll have access to the same fields. And you javascript would work.
 
If you MUST have a new window and that same window isn't an XPage, you could call a function on the originating page that returned the proper ID:s that you're after. That function will have access to the proper ID:s, since that JavaScript will be parsed for SSJS and know about the fields you're trying to get at. 
 
 
/J 

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