show hide elements JSF / primefaces with ajax

Posted: May 24, 2012 in web

<p:selectOneRadio value="#{test.panel1}">
 <f:selectItem itemLabel="Yes" itemValue="Show-Panel1" />
 <f:selectItem itemLabel="No" itemValue="Hide-Panel1" />
 <f:ajax render="payment-amount-panel" />

<h:panelGroup id="payment-amount-panel">

<p:fieldset legend="Payment"
 rendered="#{test.panel1 == 'Show-Panel1'}">

//more elements here...




public class Test {

private String panel1 = “Hide-Panel1”;

public void setPanel1(String panel1){
this.panel1 = panel1;

public String getPanel1(){
return this.panel1;


  1. Gio says:

    fine example thanks

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s