2017  Kodetalk | Feedback | Privacy Policy | Terms | About
userimage

How to deselect the single Radio button in primefaces?

In primefaces,I used single radio button(I used <p:selectOneMenu> option).I am able to perform the operation on selection of radio button.If again i clicked on the radio button ,it appears on selection mode,I just want to disable mode as it appear before select the radio bution.

<p:selectOneRadio id="radio1">
                                <f:selectItem itemLabel="Specific radio" itemValue="" />
                                <p:ajax listener="#{some action perform}"
                                    update="some fields updated" />
       </p:selectOneRadio>

userimage
<p:outputPanel id="compidtorender" rendered="#{data.renderValue}">
    <p:selectOneMenu id="someid" >
        <f:selectItems value="#{your options}" />
    </p:selectOneMenu>
</p:outputPanel>


For example :

@ManagedBean
@Sccope
public class Data{
    private boolean renderValue;
    // getter setter
}


From below ajax call update the renderValue and update the id compidtorender

<p:selectOneRadio id="radio1">
    <f:selectItem itemLabel="Specific radio" itemValue="" />
    <p:ajax listener="#{some action perform}"
        update="compidtorender" />
</p:selectOneRadio>
Answer is