I have a switch (boolean).And when switch is true,inputtext disabled option is true.When switch is false,inputtext disabled option is false and so I can input data.But this data returns null.
<h:form id="form">
<p:inputSwitch value="#{switchMB.isTrue}" onLabel="True"
offLabel="False">
<p:ajax update="inputText" />
</p:inputSwitch>
<p:inputText id="inputText" value="#{switchMB.inputTextValue}"
disabled="#{switchMB.isTrue}" />
<p:commandButton action="#{switchMB.addValue}"
update=":form" value="Add"></p:commandButton>
</h:form>
when I input the data in inputText,this data always returns null.How can I solve this problem? How to update disabled option in inputText and input the data correctly?thanks in advance..