Hi, On Tue, Nov 10, 2009 at 9:36 AM, Giambalvo, Christian < christian.giamba...@excelsisnet.com> wrote:
> Well, i don't want a timer in the page. This causes unneeded checks. > That's why I thought of the simplest solution. > The basepage gets its navigation from session (which gets rebuild upon > changes to stay up2date). > Now I need a way to notify the page that navigation changed. > So I implemented following method in basepage. > ... > public void refreshNavigation() { > > this.navigation.replaceWith(AuthenticatedWebSession.get().getNavi()); > AjaxRequestTarget.get().addComponent(this.navigation); > } > ... > > So, your Application object will act as a factory of components? I wouldn't follow that approach myself. At most the application would contain the data for the navigation and then the navigation component will fetch that data and rebuild itself. > Now all I have to do is call this method for each active page to refresh > navigation (or am I wrong?). > > Just one question? How would a remote page "know" that it has to reload itself? Do you plan to do that next time user get backs to the server with an AJAX request? If so, then you don't need anything else (I guess.) But if you want this to happen even if the user do not interact with the page. Then either you need a timer or use reverse AJAX. > Can you tell me a bit more about reverse ajax? > > Just google for reverse AJAX, comet, server push, etc and you will have enough to read... Regards, Ernesto