I need to pass javascript code (server-side and client-side) to a custom control which should then get executed on click on button inside the custom control.
For this I created a property in custom control, say codessjs, with type javax.faces.el.MethodBinding and editor as Method Binding Editor. On the click of button (inside custom control) I wrote code like this:
compositeData.codessjs.invoke(facesContext, null)
But it throws me an error 'compositeData.codessjs' is null despite the code being present in the XPage source. How can I get the code to execute?
For client side javascript code I can find the editor Client side script editor in custom control properties, but what should be the type of the property? And how can I execute the csjs code in custom control?