I have a set of 3 radio buttons (A, B, and C). Like, A="1", B="2", and C="other value". When I select C, user can write a value of is choice.
The problem is: if the user writes a value on the box, and then changes to A or B, if he chooses C, the value will still be there, and I want the value in C be cleaned.
How can I accomplish this?
Here is my jsf code :
<p:selectOneRadio required="true" id="radio" value="#{backBean. SelectedAmountOption}" layout="custom">
<f:selectItem itemLabel="#{msgs['combo.box.charge.amount.1']}" itemValue="1" />
<f:selectItem itemLabel="#{msgs['combo.box.charge.amount.2']}" itemValue="2" />
<f:selectItem itemLabel="#{msgs['combo.box.charge.amount.3']}" itemValue="3" />
<h:panelGrid columns="3" cellpadding="5">
<p:radioButton id="A " for="Aa" itemIndex="0"/>
<p:outputLabel value="#{msgs['combo.box.charge.amount.1']}" for="Aa"/>
<p:spacer/>
<p:radioButton id="B" for="Bb" itemIndex="1"/>
<p:outputLabel value="#{msgs['combo.box.charge.amount.2']}" for=" Bb "/>
<p:spacer/>
<p:radioButton id="C" for="Cc" itemIndex="2" />
<pe:inputNumber
styleClass=" Cc "
placeholder="#{msgs['combo.box.charge.amount.3']}"
value="#{backBean.e xplicitAmount}>
</pe:inputNumber>