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



Nov 13, 2013, 7:39 AM
4 Posts
topic has been resolvedResolved

Call client-side Javascript with document unid

  • Category: Other
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: Javascript,unid
  • Replies: 4

Hi, 

I am a Notes developer, but new to xpage.  What I am trying to do is to call a client-side Javascript function with document unid of current data source.  However, it doesn't work.  Here is my code.  Could someone help?  thanks in advanced!

Wanfai

 

onclick in Link object:

var x;
var sid=dominoDoc.getDocument().getUniversalID();
var r=confirm("Confirm to attach secure file?");
if (r==true)
  {
  uploadFile(sid,null);
  }

* uploadFile is my Javascript function.

Nov 13, 2013, 12:50 PM
586 Posts
hmmm

Well all I can really tell you is that won't work.  If that's client Side JavaScript then you can't access dominoDoc which I assume is the name of your bound document.

There might be a way to more or less inline create a CSJS var with the doc id...  I'm not sure...

But what I've done to interact between CSJS and SSJS is use the RPC tool in the Ext. Library/9.0+  

You give it a name and method.  The method will run serverside but gets called from client side.  So you can pass values back and forth like that.

There's at least 1 video on this on NotesIn9...  I'm not sure which one but I THINK John Jardin was the contributor.

 

Hope that helps

 

Nov 13, 2013, 1:54 PM
366 Posts
Use the following syntax

You can use the following syntax to call SSJS form CSJS

 

alert("#{javascript:document1.getDocument().getUniversalID();}")

 

where the code after javascript: is the ssjs


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