I am experiencing an issue with a certain piece of code. I have a variable called fieldToStore
that is defined. When I alert it or check its value in the firebug console, everything seems fine. However, when I pass it to myBean, it always ends up being undefined if it's a String value or false if it's boolean. Any suggestions on what might be causing this?
<a4j:commandButton id="bt1" action="#{myBean.doSomething}" onclick="fieldToStore=false;saveFieldState();">
</a4j:commandButton>
<a4j:jsFunction name="saveFieldState" action="#{myBean.dummyAction}" />
<a4j:actionparam name="fieldToStore" assignTo="#{myBean.fieldToStore}" />
</a4j:jsFunction>
My expectation is that after clicking on bt1, the value of myBean.fieldToStore should be false, based on the javascript variable fieldToStore.