my javascipt function not set value of inputHIdden in bean.
maybe someone know the reason of this problem?
java
public String test = "";
//getter and setter
jsf
<h:inputHidden id="myInputHidden" value="#{bean.test}"/>
<p:commandButton value="Apply" actionListener="#{bean.filter}" onclick="set();"/>
javascript
function set() {
var str="test"
$("#myForm\\:myInputHidden").val(str);
}
Maybe you can try:
this way you don’t need to have the JS function. If you want it to dinamically update add a Ajax call such as:
or