anu
anu

Reputation: 59

auto refresh on wicket page

I have scenario to auto refresh the wicket page but it is base page and all pages are extending it .I dont want refresh all extending pages only base page.

right now I am using html meta tag.It is refreshing all the pages.Is it possible to refresh only base page

Upvotes: 0

Views: 3076

Answers (2)

Raystorm
Raystorm

Reputation: 6528

First off I agree with @jbrookovers suggestion.

However, If you do actually want the hole page to refresh, Why not create a new class RefreshingBasePage? Then just move your <meta refresh....> to the new classes .html file. Just insert the refresh into the head via a <wicket:head></wicket:head> element.

Then you can leave your other pages free to inherit from BasePage without the refresh getting in the way.

Upvotes: 0

jbrookover
jbrookover

Reputation: 5150

When you have a

public class BasePage extends Page

and then another

public class SubPage extends BasePage

you don't actually get them as separate pieces. This method of class (and markup) extending only exists to make the process more "object" and "java" like. In the end, the entire page hierarchy is combined together to a single, rendered page.

Now, if you want one sub-part of the page to refresh, I suggest creating a Panel and adding an AjaxSelfUpdatingTimerBehavior to that component. This will let you auto refresh any part (or multiple parts) of a page without the entire thing re-rendering.

Upvotes: 5

Related Questions