开发者

Render h:panelGrid on dataTable row select?

开发者 https://www.devze.com 2023-03-31 14:14 出处:网络
I have a dataTable that when a user selects a row a number of fields are populated so they can see more detail. of that particular item. However, at the moment the page loads with the unpopulated pane

I have a dataTable that when a user selects a row a number of fields are populated so they can see more detail. of that particular item. However, at the moment the page loads with the unpopulated panelgrid and populates on selecting of a row. How 开发者_JAVA技巧can I hide this panelgrid and get it to show once the row has been selected??

Thanks


Use the rendered attribute and let it evaluate true if anything has been selected.

E.g.

<h:panelGrid rendered="#{not empty bean.selectedRow}">
    <h:outputText value="#{bean.selectedRow.foo}" />
    <h:outputText value="#{bean.selectedRow.bar}" />
    ...
</h:panelGrid>
0

精彩评论

暂无评论...
验证码 换一张
取 消