I have created an xPages application which uses a lot of server side javascript code functions located in a server side javascript library.
Now I have some java code located in the java design element which I would like to use to call the javascript functions.
I do understand that it is not logical to call javascript from java, but I guess that all server side javascript is compiled to java, so I was thinking that it might be possible to get a handle to the compiled java class that was generated.
any ideas?
You can create a value binding,
ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{javascript:getData()}");
System.out.println(vb.getValue(FacesContext.getCurrentInstance()).toString());
This would call the getData()
method from your SSJS library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With