I have two grids, and one tabView which contains 2 tabs, for first tab I have to show panelgrid1, and for tab2 = panelgrid2. I have used rendered attribute for both panels, and used tabchange event in tabView, this listener updates the status attribute in java, but in xhtml, same grid is still shown and doesn't change 2nd panelgrid.
1 Answers
0
votes
You need to make absolutely sure that you refer in ajax update/render a component which is always rendered. It is not possible to refer a component which is by itself conditionally rendered in order to show/hide it.
<p:ajax ... update="foo" />
...
<h:panelGroup id="foo">
<h:panelGrid ... rendered="#{bean.grid == 1}">
...
</h:panelGrid>
<h:panelGrid ... rendered="#{bean.grid == 2}">
...
</h:panelGrid>
</h:panelGroup>