Heetola
Heetola

Reputation: 6181

Panelgrid rendered property in JSF

in a composite component I have this piece of code

<composite:interface>
    <composite:attribute name="bean" required="true"/>
    <composite:attribute name="selectable" required="true"/>
</composite:interface>

<composite:implementation>
............

<h:panelGrid rendered="#{cc.attrs.selectable}"> 
    <h:column styleClass="colonneCheckbox">
        <center><h:selectBooleanCheckbox value="#{liste.selected}" /></center>
    </h:column>
</h:panelGrid>  

.............

</composite:implementation>

</html>

And I call it this way :

<ccc:resultatRechercheClient bean="#{rechercheClient}" selectable="true"/>

However the panegrid is not rendered, is it because the only way to activate it is to create a boolean variable inside the bean, set it to true and then pass it as a parameter?

something like this :

<ccc:resultatRechercheClient bean="#{rechercheClient}" selectable="#{rechercheClient.render}"/>

thanks

Upvotes: 0

Views: 687

Answers (1)

BalusC
BalusC

Reputation: 1108692

The <h:panelGrid> doesn't support <h:column> at all. Use <h:panelGroup> instead.

<h:panelGrid rendered="#{cc.attrs.selectable}"> 
    <h:panelGroup styleClass="colonneCheckbox">
        <center><h:selectBooleanCheckbox value="#{liste.selected}" /></center>
    </h:panelGroup>
</h:panelGrid>  

By the way, the HTML <center> element is deprecated since 1998. Use CSS for styling and positioning and make sure that you learn HTML based on up to date resources.

Upvotes: 2

Related Questions