๐:0
you can try to use jsf expression language in javascript code
For example:
//<![CDATA[
var jsVar = #{managedBean.property}
//]]>
- ChartJs has animation every time angular refresh the data
- How to set global/specific properies when updating line-chart using Chart.js?
๐:0
Well, if you are concerned with the calling (and passing values) of JS function from bean, then you can call execute
of RequestContext.getCurrentInstance()
to directly invoke your scripting method from the bean, as following:
RequestContext.getCurrentInstance().execute("yourJSFunction('" + param1 + "');");
However, I think you will still be missing a trick of converting your JSONArray
back to JSON
object in JS, which you can do as following:
When passed from bean:
function yourJSFunction(coordinatesArray) {
coordinatesArray = JSON.parse(coordinatesArray);
}
Or when using as a bean property:
var coordinatesArr = JSON.parse('#{yourBean.strProperty}');