Re: Force page reload/re-render
Thanks for all the feedback. onBeforeRender() works like a charm. Pieter On Tue, Nov 10, 2009 at 2:51 PM, Michael O'Cleirigh wrote: > Hi Pieter, > > Components that have .setVisible(false) will never be evaluated again > automatically. You need to call .setVisible(true) on all that apply. > > One way would be control visibility in the base panel by overriding > onBeforeRender() to handle all the cases in one place. e.g. > > class ControlPanel extends Panel { > > protected void onBeforeRender () { > Role role = getModelObject(); > > caseOnePanel.setVisible(false); > caseTwoPanel.setVisible (false); > > if (role instanceof CaseOne) { > caseOnePanel.setVisible (true); > } > else if (role instanceof CaseTwo) { > caseTwoPanel.setVisible (true); > } > } > } > > Or you could override .isVisible() in your sub panels to control when they > are visible. > > I like the on before render way myself because there is no performance > penalty if the visibility logic is complex (Component.isVisible() is called > alot during the rendering phase). > > Regards, > > Mike >> >> To recap, I have a control panel visible on each and every page and in >> that control panel, you can select the appropriate role you want to >> use. Based on that role some menu items will be visible or not >> (example below is correct). I am sure this problem has been solved >> before :-0 as this is a very normal usecase for context sensitive >> navigation. >> >> It seems that there is no way to force the page to re-render using >> getPage()? >> >> Thanks for the feedback so far. I keep on coming up against this issue >> and have not found a reasonable solution to the problem. The >> javascript option seems to be best so far. >> >> Pieter >> >> On Tue, Nov 10, 2009 at 1:41 PM, Ernesto Reinaldo Barreiro >> wrote: >> >>> >>> Even if you re-render your page components that are not "dynamic" will >>> not >>> change their state: unless you create a new instance of the page, I >>> guess. >>> By this I mean. >>> >>> class MyPanel { >>> public MyPanel(id) { >>> PanelB panelB = new Panel("B"); >>> panelB.setVisible(getSomeCondition()); >>> >>> } >>> } >>> >>> Even if condition getSomeCondition() change, and you re-render MyPanel, >>> or >>> the whole page, panelB will still be not visible. So, if you want >>> something >>> to be dynamic you have to program it to be dynamic. >>> >>> Best, >>> >>> Ernesto >>> >>> >>> On Tue, Nov 10, 2009 at 1:20 PM, pieter claassen >>> >>> wrote: >>> Both of the suggestions I think requires me to modify the logic of the controls (either to keep track of which ones need to be updated or by placing the rendering logic in onBeforeRender()). I think this is a lot of work for something relative straight forward and also any changes to permission structures and I have to modify controls. Is there no way that I can mark a page obtained via getPage() as requiring re-rendering? I tried getPage().dirty() before the setResponsePage() but that didn't do anything. Thanks for the feedback though. P On Tue, Nov 10, 2009 at 1:10 PM, Pedro Santos wrote: > > I tried setResponsePage(getPage()) but the problem is it does not > re-render controls on the page. > > Where do you implement your control ( update logic )? Consider do it > overriding Component.onBeforeRender method > > On Tue, Nov 10, 2009 at 10:03 AM, pieter claassen > wrote: > >> >> Hi Pedro, >> >> I tried setResponsePage(getPage()) but the problem is it does not >> re-render controls on the page. >> >> setResponsePage(getPage().getClass()) only works for stateless pages >> and on most of my pages, I pass params via the constructor. >> >> The javascript option will be a last resort, but it seems to be not >> the most elegant solution. >> >> Rgds, >> >> On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos >> wrote: >> >>> >>> if(userSetWasChanged){ >>> target.appendJavascript("window.location.reload()"); >>> or >>> setResponsePage(getPage()); >>> or >>> setResponsePage(getPage().getClass()); >>> } >>> >>> >>> On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen >>> >>> wrote: >>> I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes >>
Re: Force page reload/re-render
Hi Pieter, Components that have .setVisible(false) will never be evaluated again automatically. You need to call .setVisible(true) on all that apply. One way would be control visibility in the base panel by overriding onBeforeRender() to handle all the cases in one place. e.g. class ControlPanel extends Panel { protected void onBeforeRender () { Role role = getModelObject(); caseOnePanel.setVisible(false); caseTwoPanel.setVisible (false); if (role instanceof CaseOne) { caseOnePanel.setVisible (true); } else if (role instanceof CaseTwo) { caseTwoPanel.setVisible (true); } } } Or you could override .isVisible() in your sub panels to control when they are visible. I like the on before render way myself because there is no performance penalty if the visibility logic is complex (Component.isVisible() is called alot during the rendering phase). Regards, Mike To recap, I have a control panel visible on each and every page and in that control panel, you can select the appropriate role you want to use. Based on that role some menu items will be visible or not (example below is correct). I am sure this problem has been solved before :-0 as this is a very normal usecase for context sensitive navigation. It seems that there is no way to force the page to re-render using getPage()? Thanks for the feedback so far. I keep on coming up against this issue and have not found a reasonable solution to the problem. The javascript option seems to be best so far. Pieter On Tue, Nov 10, 2009 at 1:41 PM, Ernesto Reinaldo Barreiro wrote: Even if you re-render your page components that are not "dynamic" will not change their state: unless you create a new instance of the page, I guess. By this I mean. class MyPanel { public MyPanel(id) { PanelB panelB = new Panel("B"); panelB.setVisible(getSomeCondition()); } } Even if condition getSomeCondition() change, and you re-render MyPanel, or the whole page, panelB will still be not visible. So, if you want something to be dynamic you have to program it to be dynamic. Best, Ernesto On Tue, Nov 10, 2009 at 1:20 PM, pieter claassen wrote: Both of the suggestions I think requires me to modify the logic of the controls (either to keep track of which ones need to be updated or by placing the rendering logic in onBeforeRender()). I think this is a lot of work for something relative straight forward and also any changes to permission structures and I have to modify controls. Is there no way that I can mark a page obtained via getPage() as requiring re-rendering? I tried getPage().dirty() before the setResponsePage() but that didn't do anything. Thanks for the feedback though. P On Tue, Nov 10, 2009 at 1:10 PM, Pedro Santos wrote: I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. Where do you implement your control ( update logic )? Consider do it overriding Component.onBeforeRender method On Tue, Nov 10, 2009 at 10:03 AM, pieter claassen wrote: Hi Pedro, I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. setResponsePage(getPage().getClass()) only works for stateless pages and on most of my pages, I pass params via the constructor. The javascript option will be a last resort, but it seems to be not the most elegant solution. Rgds, On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos wrote: if(userSetWasChanged){ target.appendJavascript("window.location.reload()"); or setResponsePage(getPage()); or setResponsePage(getPage().getClass()); } On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen wrote: I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes complex when you have a mix of statefull and stateless pages as targets (and it just doesn't feel right). I am sure there must be an easier way to just re-render a page? Any tips? Thanks, pieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos -- Pieter Claassen musmato.com -- Pedro Henrique Oliveira dos Santos -- Pieter Claassen musmato.com
Re: Force page reload/re-render
The page will be re-rendered... Implement your menu item componentes isVisible method to return true due your context Enviado de meu iPhone Em 10/11/2009, às 11:39, pieter claassen escreveu: Hi Ernesto, To recap, I have a control panel visible on each and every page and in that control panel, you can select the appropriate role you want to use. Based on that role some menu items will be visible or not (example below is correct). I am sure this problem has been solved before :-0 as this is a very normal usecase for context sensitive navigation. It seems that there is no way to force the page to re-render using getPage()? Thanks for the feedback so far. I keep on coming up against this issue and have not found a reasonable solution to the problem. The javascript option seems to be best so far. Pieter On Tue, Nov 10, 2009 at 1:41 PM, Ernesto Reinaldo Barreiro wrote: Even if you re-render your page components that are not "dynamic" will not change their state: unless you create a new instance of the page, I guess. By this I mean. class MyPanel { public MyPanel(id) { PanelB panelB = new Panel("B"); panelB.setVisible(getSomeCondition()); } } Even if condition getSomeCondition() change, and you re-render MyPanel, or the whole page, panelB will still be not visible. So, if you want something to be dynamic you have to program it to be dynamic. Best, Ernesto On Tue, Nov 10, 2009 at 1:20 PM, pieter claassen > wrote: Both of the suggestions I think requires me to modify the logic of the controls (either to keep track of which ones need to be updated or by placing the rendering logic in onBeforeRender()). I think this is a lot of work for something relative straight forward and also any changes to permission structures and I have to modify controls. Is there no way that I can mark a page obtained via getPage() as requiring re-rendering? I tried getPage().dirty() before the setResponsePage() but that didn't do anything. Thanks for the feedback though. P On Tue, Nov 10, 2009 at 1:10 PM, Pedro Santos wrote: I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. Where do you implement your control ( update logic )? Consider do it overriding Component.onBeforeRender method On Tue, Nov 10, 2009 at 10:03 AM, pieter claassen wrote: Hi Pedro, I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. setResponsePage(getPage().getClass()) only works for stateless pages and on most of my pages, I pass params via the constructor. The javascript option will be a last resort, but it seems to be not the most elegant solution. Rgds, On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos > wrote: if(userSetWasChanged){ target.appendJavascript("window.location.reload()"); or setResponsePage(getPage()); or setResponsePage(getPage().getClass()); } On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen wrote: I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes complex when you have a mix of statefull and stateless pages as targets (and it just doesn't feel right). I am sure there must be an easier way to just re-render a page? Any tips? Thanks, pieter --- --- --- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos -- Pieter Claassen musmato.com -- Pedro Henrique Oliveira dos Santos -- Pieter Claassen musmato.com -- Pieter Claassen musmato.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Force page reload/re-render
Hi Pieter Due to the Java-Nature of Wicket, things done in the constructor are only executed once for this instance. Since F5 only re-renders the instance, the expression setVisible(whatever()) is only executed once. The most dynamic implementation would be to override isVisible() for every component that changes its visibility dynamically or if that would lead to lots of code duplication, you could write a behaviour doing exactly that and add it to every component (or container) as needed. isVisible() is evaluated during each and every rendering phase, meaning upon every F5 reload as well. This is the way we do it for dynamic content. Matt pieter claassen wrote: Hi Ernesto, To recap, I have a control panel visible on each and every page and in that control panel, you can select the appropriate role you want to use. Based on that role some menu items will be visible or not (example below is correct). I am sure this problem has been solved before :-0 as this is a very normal usecase for context sensitive navigation. It seems that there is no way to force the page to re-render using getPage()? Thanks for the feedback so far. I keep on coming up against this issue and have not found a reasonable solution to the problem. The javascript option seems to be best so far. Pieter On Tue, Nov 10, 2009 at 1:41 PM, Ernesto Reinaldo Barreiro wrote: Even if you re-render your page components that are not "dynamic" will not change their state: unless you create a new instance of the page, I guess. By this I mean. class MyPanel { public MyPanel(id) { PanelB panelB = new Panel("B"); panelB.setVisible(getSomeCondition()); } } Even if condition getSomeCondition() change, and you re-render MyPanel, or the whole page, panelB will still be not visible. So, if you want something to be dynamic you have to program it to be dynamic. Best, Ernesto On Tue, Nov 10, 2009 at 1:20 PM, pieter claassen wrote: Both of the suggestions I think requires me to modify the logic of the controls (either to keep track of which ones need to be updated or by placing the rendering logic in onBeforeRender()). I think this is a lot of work for something relative straight forward and also any changes to permission structures and I have to modify controls. Is there no way that I can mark a page obtained via getPage() as requiring re-rendering? I tried getPage().dirty() before the setResponsePage() but that didn't do anything. Thanks for the feedback though. P On Tue, Nov 10, 2009 at 1:10 PM, Pedro Santos wrote: I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. Where do you implement your control ( update logic )? Consider do it overriding Component.onBeforeRender method On Tue, Nov 10, 2009 at 10:03 AM, pieter claassen wrote: Hi Pedro, I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. setResponsePage(getPage().getClass()) only works for stateless pages and on most of my pages, I pass params via the constructor. The javascript option will be a last resort, but it seems to be not the most elegant solution. Rgds, On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos wrote: if(userSetWasChanged){ target.appendJavascript("window.location.reload()"); or setResponsePage(getPage()); or setResponsePage(getPage().getClass()); } On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen wrote: I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes complex when you have a mix of statefull and stateless pages as targets (and it just doesn't feel right). I am sure there must be an easier way to just re-render a page? Any tips? Thanks, pieter smime.p7s Description: S/MIME Cryptographic Signature
Re: Force page reload/re-render
Hi Ernesto, To recap, I have a control panel visible on each and every page and in that control panel, you can select the appropriate role you want to use. Based on that role some menu items will be visible or not (example below is correct). I am sure this problem has been solved before :-0 as this is a very normal usecase for context sensitive navigation. It seems that there is no way to force the page to re-render using getPage()? Thanks for the feedback so far. I keep on coming up against this issue and have not found a reasonable solution to the problem. The javascript option seems to be best so far. Pieter On Tue, Nov 10, 2009 at 1:41 PM, Ernesto Reinaldo Barreiro wrote: > Even if you re-render your page components that are not "dynamic" will not > change their state: unless you create a new instance of the page, I guess. > By this I mean. > > class MyPanel { > public MyPanel(id) { > PanelB panelB = new Panel("B"); > panelB.setVisible(getSomeCondition()); > > } > } > > Even if condition getSomeCondition() change, and you re-render MyPanel, or > the whole page, panelB will still be not visible. So, if you want something > to be dynamic you have to program it to be dynamic. > > Best, > > Ernesto > > > On Tue, Nov 10, 2009 at 1:20 PM, pieter claassen > wrote: >> >> Both of the suggestions I think requires me to modify the logic of the >> controls (either to keep track of which ones need to be updated or by >> placing the rendering logic in onBeforeRender()). I think this is a >> lot of work for something relative straight forward and also any >> changes to permission structures and I have to modify controls. >> >> Is there no way that I can mark a page obtained via getPage() as >> requiring re-rendering? I tried getPage().dirty() before the >> setResponsePage() but that didn't do anything. >> >> Thanks for the feedback though. >> P >> >> On Tue, Nov 10, 2009 at 1:10 PM, Pedro Santos wrote: >> > I tried setResponsePage(getPage()) but the problem is it does not >> > re-render controls on the page. >> > >> > Where do you implement your control ( update logic )? Consider do it >> > overriding Component.onBeforeRender method >> > >> > On Tue, Nov 10, 2009 at 10:03 AM, pieter claassen >> > wrote: >> >> >> >> Hi Pedro, >> >> >> >> I tried setResponsePage(getPage()) but the problem is it does not >> >> re-render controls on the page. >> >> >> >> setResponsePage(getPage().getClass()) only works for stateless pages >> >> and on most of my pages, I pass params via the constructor. >> >> >> >> The javascript option will be a last resort, but it seems to be not >> >> the most elegant solution. >> >> >> >> Rgds, >> >> >> >> On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos >> >> wrote: >> >> > if(userSetWasChanged){ >> >> > target.appendJavascript("window.location.reload()"); >> >> > or >> >> > setResponsePage(getPage()); >> >> > or >> >> > setResponsePage(getPage().getClass()); >> >> > } >> >> > >> >> > >> >> > On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen >> >> > >> >> > wrote: >> >> >> >> >> >> I have a link on a panel that is included in many pages. When the >> >> >> user >> >> >> clicks on the link, I change something in the user settings that >> >> >> will >> >> >> affect what gets displayed on the page. However, for that to work, I >> >> >> need to reload the page after the user clicked on the link as by >> >> >> default the other components that now need to be checked for >> >> >> conditional visibility don't re-render (why not?). setResponsePage() >> >> >> requires me to pass into the panel a target page and this becomes >> >> >> complex when you have a mix of statefull and stateless pages as >> >> >> targets (and it just doesn't feel right). >> >> >> >> >> >> I am sure there must be an easier way to just re-render a page? >> >> >> >> >> >> Any tips? >> >> >> >> >> >> Thanks, >> >> >> pieter >> >> >> >> >> >> >> >> >> - >> >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> >> >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> >> >> > >> >> > >> >> > >> >> > -- >> >> > Pedro Henrique Oliveira dos Santos >> >> > >> >> >> >> >> >> >> >> -- >> >> Pieter Claassen >> >> musmato.com >> > >> > >> > >> > -- >> > Pedro Henrique Oliveira dos Santos >> > >> >> >> >> -- >> Pieter Claassen >> musmato.com > > -- Pieter Claassen musmato.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Force page reload/re-render
Both of the suggestions I think requires me to modify the logic of the controls (either to keep track of which ones need to be updated or by placing the rendering logic in onBeforeRender()). I think this is a lot of work for something relative straight forward and also any changes to permission structures and I have to modify controls. Is there no way that I can mark a page obtained via getPage() as requiring re-rendering? I tried getPage().dirty() before the setResponsePage() but that didn't do anything. Thanks for the feedback though. P On Tue, Nov 10, 2009 at 1:10 PM, Pedro Santos wrote: > I tried setResponsePage(getPage()) but the problem is it does not > re-render controls on the page. > > Where do you implement your control ( update logic )? Consider do it > overriding Component.onBeforeRender method > > On Tue, Nov 10, 2009 at 10:03 AM, pieter claassen > wrote: >> >> Hi Pedro, >> >> I tried setResponsePage(getPage()) but the problem is it does not >> re-render controls on the page. >> >> setResponsePage(getPage().getClass()) only works for stateless pages >> and on most of my pages, I pass params via the constructor. >> >> The javascript option will be a last resort, but it seems to be not >> the most elegant solution. >> >> Rgds, >> >> On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos >> wrote: >> > if(userSetWasChanged){ >> > target.appendJavascript("window.location.reload()"); >> > or >> > setResponsePage(getPage()); >> > or >> > setResponsePage(getPage().getClass()); >> > } >> > >> > >> > On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen >> > >> > wrote: >> >> >> >> I have a link on a panel that is included in many pages. When the user >> >> clicks on the link, I change something in the user settings that will >> >> affect what gets displayed on the page. However, for that to work, I >> >> need to reload the page after the user clicked on the link as by >> >> default the other components that now need to be checked for >> >> conditional visibility don't re-render (why not?). setResponsePage() >> >> requires me to pass into the panel a target page and this becomes >> >> complex when you have a mix of statefull and stateless pages as >> >> targets (and it just doesn't feel right). >> >> >> >> I am sure there must be an easier way to just re-render a page? >> >> >> >> Any tips? >> >> >> >> Thanks, >> >> pieter >> >> >> >> - >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > >> > >> > >> > -- >> > Pedro Henrique Oliveira dos Santos >> > >> >> >> >> -- >> Pieter Claassen >> musmato.com > > > > -- > Pedro Henrique Oliveira dos Santos > -- Pieter Claassen musmato.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Force page reload/re-render
Isn't AJAX refresh an option to consider here? For instance, defining some "contexts" which need to be re-rendered (e.g. marking them with an interface) and them having and IVisitor that collects all those contexts and add them to the AjaxRequestTarget? Best, Ernesto On Tue, Nov 10, 2009 at 8:19 AM, pieter claassen wrote: > I have a link on a panel that is included in many pages. When the user > clicks on the link, I change something in the user settings that will > affect what gets displayed on the page. However, for that to work, I > need to reload the page after the user clicked on the link as by > default the other components that now need to be checked for > conditional visibility don't re-render (why not?). setResponsePage() > requires me to pass into the panel a target page and this becomes > complex when you have a mix of statefull and stateless pages as > targets (and it just doesn't feel right). > > I am sure there must be an easier way to just re-render a page? > > Any tips? > > Thanks, > pieter > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Force page reload/re-render
Hi Pedro, I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. setResponsePage(getPage().getClass()) only works for stateless pages and on most of my pages, I pass params via the constructor. The javascript option will be a last resort, but it seems to be not the most elegant solution. Rgds, On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos wrote: > if(userSetWasChanged){ > target.appendJavascript("window.location.reload()"); > or > setResponsePage(getPage()); > or > setResponsePage(getPage().getClass()); > } > > > On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen > wrote: >> >> I have a link on a panel that is included in many pages. When the user >> clicks on the link, I change something in the user settings that will >> affect what gets displayed on the page. However, for that to work, I >> need to reload the page after the user clicked on the link as by >> default the other components that now need to be checked for >> conditional visibility don't re-render (why not?). setResponsePage() >> requires me to pass into the panel a target page and this becomes >> complex when you have a mix of statefull and stateless pages as >> targets (and it just doesn't feel right). >> >> I am sure there must be an easier way to just re-render a page? >> >> Any tips? >> >> Thanks, >> pieter >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> > > > > -- > Pedro Henrique Oliveira dos Santos > -- Pieter Claassen musmato.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Force page reload/re-render
if(userSetWasChanged){ target.appendJavascript("window.location.reload()"); or setResponsePage(getPage()); or setResponsePage(getPage().getClass()); } On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen wrote: > I have a link on a panel that is included in many pages. When the user > clicks on the link, I change something in the user settings that will > affect what gets displayed on the page. However, for that to work, I > need to reload the page after the user clicked on the link as by > default the other components that now need to be checked for > conditional visibility don't re-render (why not?). setResponsePage() > requires me to pass into the panel a target page and this becomes > complex when you have a mix of statefull and stateless pages as > targets (and it just doesn't feel right). > > I am sure there must be an easier way to just re-render a page? > > Any tips? > > Thanks, > pieter > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Pedro Henrique Oliveira dos Santos