user3573655
user3573655

Reputation: 1

Primefaces Reload an XHTML Page On Tab Change

I am using a Primefaces Accordion component. Each tab displays a xhtml page containing a DataTable.

I need to be able to refresh the page when the user selects the tab so that they can see changes to the Favorites list or the Contacts list. Each list page has its own Managed Bean.

I am very new to JSF and PrimeFaces. Would appreciate any help :)

<p:accordionPanel widgetVar="accordion">
    <p:tab title="My Favorites" id="myFavorites">
        <ui:insert name="favorites" >
            <ui:include src="/xhtml/favoritesList.xhtml" />
        </ui:insert>
    </p:tab>

    <p:tab title="My Contacts" id="myContacts">
        <ui:insert name="contacts" >
            <ui:include src="/xhtml/contactsList.xhtml" />
        </ui:insert>
    </p:tab>
</p:accordionPanel>

Upvotes: 0

Views: 1924

Answers (1)

user2880020
user2880020

Reputation:

Replace your first line by the following code which satisfies your requirement (uncached lazy loading).

<p:accordionPanel widgetVar="accordion" dynamic="true" cache="false">

Upvotes: 1

Related Questions