This Question is a follow up to JSF Primefaces Radio Button show/hide/enable a textarea One of the two problems were solved from that Post by wrapping the inputTextArea in a panelGroup, however I still need to figure out how to not show the inputTextArea on form load when the status is a 2 (=No), but only show when the radio under column 2 is being toggled.
<p:column ...>
<p:selectOneRadio ...>
...
<p:ajax update="reason" />
</p:selectOneRadio>
</p:column>
<p:column headerText="Reason For Attribute Failure">
<h:panelGroup id="reason">
<h:inputTextarea value="#{qAndA.fail_reason}" rendered="#{qAndA.toggle_value == '2'}" />
</h:panelGroup>
<h:outputText value="" rendered="#{qAndA.toggle_value == '1' or qAndA.toggle_value == '3'}" />
<h:outputText value="#{qAndA.fail_reason}" rendered="#{qAndA.toggle_value == '2' or qAndA.toggle_value == '4'}" />
</p:column>
perhaps the status codes are flawed:
- 0 = no input yet
- 1 = yes
- 2 = no, with a reason
- 3 = Not Applicable
- 4 = the No was eventually resolved
I'd rather not have to modify the status codes but adding another intermediate code, something like this would probably work:
- 2 = show reason box
- 2.5 means no with a reason
Any other options besides modifying status code?