Question

I have <rich:tabPanel> with an attribute itemChangeListener="#{panelChangeListener.change} that loads the content for the selected panel (items from the database) and adds it to another div. However, when the page loads, the itemChangeListener is not called that causes a blank div. Even when the already loaded tab is clicked, the itemChangeListener is not called.

The code sample can look like this:

   <rich:tabPanel switchType="server" selectedTab="first" itemChangeListener="#{panelChangeListener.change}">
                <rich:tab name="first" header="First">
                </rich:tab>
                <rich:tab name="second" header="Second">
                </rich:tab>
   </rich:tabPanel>

Is there a way to make it call? Is this an expected behavior?

Was it helpful?

Solution

The listener is fired when you switch tabs so clicking on an already loaded tab will do nothing. You should have the data ready for the first tab when you decide to display it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top