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



Aug 16, 2012, 6:18 AM
23 Posts

Message box in ssjs

  • Category: Server Side JavaScript
  • Platform: Other
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 6
How to display msgbox in ssjs to the browser, on click of a button.
 
We use the alert in csjs. But if we use msgbox in ssjs, it prints the message in server. So how this can be achieved???
Aug 16, 2012, 12:23 PM
56 Posts
Re: Message box in ssjs
Hi,
if I understand you correctly, you can't. It is server side Javascript. That means it is executed on the server, not in the client. So the only thing you can do with SSJS is to print on the server console.
 
Alternatively, you could set a scoped variable (requestScope, sessionScope or something) in your SSJS and then in the onClientLoad event of the Xpages you can execute an alert with the content of the scoped variable. You can access serverside variables in clientside javascript with "#{javascript:sessionScope.test}" within your CSJS.
 
Hope this helps.
 
http://mnicklisch.wordpress.com
Aug 16, 2012, 1:03 PM
23 Posts
Re: Message box in ssjs
Thats great, Thanks Nick
Aug 16, 2012, 7:11 PM
366 Posts
Re: Message box in ssjs
 If you are using 8.5.3 then you can use the following to pop an alert box at the end of your SSJS 
 
This is new to 8.5.3 
 
 

var scriptCode = "alert('Submit Button - Full Refresh Click Event')"

view.postScript(scriptCode); 
Aug 17, 2012, 4:30 PM
135 Posts
Re: Message box in ssjs
Hi,
 
Paul posted a ready SSJS code for you. view refers to JSF view (which in Domino means XPage). 
 
I tried this quickly in beforePageLoad event and it works!
 
Thanks Paul, 
 
- Panu 

Aug 29, 2012, 1:36 PM
26 Posts
Re: Message box in ssjs
I have a ready made code which shows alerts using SSJS. Please refer to the below link:
 
http://www-10.lotus.com/ldd/xpagesforum.nsf/topicThread.xsp?action=openDocument&documentId=CC4CA72CCF19420085257A1C0025EDB7#427349C98B2954B585257A1D00384404
 

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