lundi 5 septembre 2016

Changing attribute rendered or visible in primefaces via checkbox

How can I change the attribute rendered/ visible to true which is initially set to false when I click on a checkbox ?

<p:selectBooleanCheckbox itemLabel = "Show">
   <p:ajax execute = "age" render = "true"/>
</p:selectBooleanCheckbox>

What I want to achieve is that upon check of the checkbox, an additional column is generated (ajax) to display the Age records.

<p:column headerText="Age" visible= "false" id = "age">
        <h:outputText value="#{stud.age}" />
</p:column> 

Any idea how can I achieve this in primefaces or using javascript? Thanks

Aucun commentaire:

Enregistrer un commentaire