Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabView: Widget method to reload dynamic panel #8007

Closed
melloware opened this issue Oct 22, 2021 · 0 comments · Fixed by #8008
Closed

TabView: Widget method to reload dynamic panel #8007

melloware opened this issue Oct 22, 2021 · 0 comments · Fixed by #8008
Assignees
Labels
enhancement Additional functionality to current component workaround A workaround has been provided

Comments

@melloware
Copy link
Member

Description
Requested on Stack Overflow: https://stackoverflow.com/questions/69667691/can-a-primefaces-tab-be-manually-reset-to-force-a-reload

I'm using a Primefaces tabView with the dynamic and cache attributes set to true - each tab is thus loaded the first time it's displayed and then cached so it does need to be reloaded. Is there a way to manually force a reload of an already cached tab so that the next time it is displayed it's content is fetched again from the server and not from the cache?

I have provided this MonkeyPatch fix which should be just first class in the TabView.

if (PrimeFaces.widget.TabView) {
    PrimeFaces.widget.TabView.prototype.reloadTab = function(index) {
        var reloadPanel = this.panelContainer.children().eq(index);
        reloadPanel.data('loaded', false);
        this.select(index);
    }
}
@melloware melloware added enhancement Additional functionality to current component workaround A workaround has been provided labels Oct 22, 2021
@melloware melloware self-assigned this Oct 22, 2021
melloware added a commit to melloware/primefaces that referenced this issue Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Additional functionality to current component workaround A workaround has been provided
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant