Based on the value of the inputHidden field, certain functionality should be performed on the javascript side.
<h:inputHidden id="onlyCaseSensitive" value="#{testBean.isPageAllowed()}"/>
Afer the javascript is executed, the application throws an error
Property not qritable Illegal Syntax for Set Operation
Your EL expression
#{}is invalid. It must evaluate as a value expression, not as a method expression. It isn’t possible to perform a setter method call on the given method expression, while that’s required when the JSF form is to be submitted. You need to remove theisprefix and those parentheses to make it a valid value expression.This requires a
public boolean isPageAllowed()getter method and apublic void setPageAllowed(boolean pageAllowed)setter method.If you actually only need to use the JSF managed bean property as a JavaScript variable, then you shouldn’t be rendering it as a hidden input at all, but just let JSF render a fullworthy JavaScript variable without the need to mess with hidden inputs and HTML DOM traversal.
E.g.
This will end up in the JSF generated HTML output like as follows (rightclick page and do View Source to see it):