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



Jan 7, 2013, 9:39 PM
17 Posts

Equivalent of click() method in SSJS?

  • Category: Dojo and Client Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role:
  • Tags:
  • Replies: 2
I have a custom control, which creates a PDF when you click it's button.
At the end of that script, I want to click another button that's on the Xpage, just as you would using CSJS.
 
This is the script used on the SSJS button.
 
 
var pdfData = compositeData.get("pdfData");
if (compositeData.pdfRenderType.toString() == "OutputStream") {
    exportPdfOutputStream(pdfData, compositeData.templatePdfName);   
} else {
    var returnValue = exportPdfFile(pdfData, compositeData.templatePdfName, compositeData.targetFilename);
   
    if (compositeData.redirectPage != null) {
        context.redirectToPage(compositeData.redirectPage);
    }   
}



Is there anything I can add to this code get then click the other button whose name and  ID is "SaveButton"?
What is the equivalent of document.getElementtById('SaveButton').click()  OR document.forms[0].SaveButton.click()  when using CSJS?
Jan 8, 2013, 10:54 AM
298 Posts
how about
Have a panel on the page and in the onClientLoad event put in your CSJS you want to run. Maybe use a scoped variable set in your SSJS to control if this panel loads or not? Howard
Jan 8, 2013, 2:08 PM
298 Posts
Another option
Use the postScript method to trigger your CSJS http://openntf.org/XSnippets.nsf/snippet.xsp?id=display-client-side-alert-if-ser ver-side-validation-fails Howard

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