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 26, 2013, 3:18 PM
11 Posts

SSJS Confirm message

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: SSJS,confirm
  • Replies: 4

All, I have a xPage with PostNewDocument event, I want to write confirm action in the middle of the SSJS code to execute remaining part of the code, I am not able to find confirm action code in the SSJS for the PostNewDocument event, I tried to put the confirm message in a dialogbox and try to display Dialogbox by using getCompomnent(“Dialobox”).show but no luck, I was not able to get the dialogbox as getComponent() is NULL  in the PostNewDocument event, all I need as something like window.confirm in the SSJS please help me…

Jul 26, 2013, 5:54 PM
586 Posts
Simple Actions

there's a confirm Action in the simple actions...  you might be able to use that with additional actions to execute script...

 

Just a thought

Jul 26, 2013, 5:57 PM
11 Posts
SSJS Confirm message

Here is my code:

var personDoc = remoreDb.getDocumentByKey(key, true)

     if (personDoc !=null){

-- Here I need

if (window.confirm("Do you want to add your name")){

then perform SSJS

}

}

 

Jul 26, 2013, 6:28 PM
586 Posts
hmmm

Sorry...  that's not enough for me to go on and I can't really write it for you...  I think simple actions might be helpful but not sure if that will fit your use case.

I don't do much with CSJS but if you really want to go down that path you can call SSJS from CSJS a couple way...  like the JSON-RPC control I think.  There's been some videos on NotesIn9 and I think XpagesWiki.com might have some info...  Google might work.

I would try to do it all in SSJS...  if you can't get the dialogbox working...  just unhide a panel with the "do you want to continue" and a button for the remaining code...  something like that...

 

Just some thoughts.

Jul 26, 2013, 6:39 PM
11 Posts
Dialogbox is now working

Thanks David for your help, I was not able to get the Dialogbox in PostNewDocument, so what I did was set a requestScope flag in the PostNewDocument and I called the Dialogbox in the afterPageLoad event and now Dialogbox is showing up with the message, and I executed remaining part of my SSJS code on the Dialogbox Button Bars :) It was little work but not great work.

Please share if you have better way of handling this situation. I will try to get it done using CSJS, but for now this workaround is working fine with me.


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