You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Rodrigo De Castro <ro...@sacaluta.com> on 2009/04/29 04:14:25 UTC
AjaxTabbedPanel, AjaxLazyLoadPanel and back button
Hey,
I've been using AjaxTabbedPanel successfully, but ran into the following
problem today:
1. Load page that has multiple tabs
2. Click on the second tab
3. Click on link on the tab panel that takes me to another page
4. Press back button
It fails with the following error:
WicketMessage: component
tabpanel:mytabpanel:panel:general_workflow_panel:graph_container not found
on page
The container (graph_container) is an AjaxLazyLoadPanel. If I don't load it
lazyly, it works fine. Is this a known bug? Or maybe I am not using
AjaxLazyLoadPanel properly? Let me know if you need more information.
AjaxLazyLoadPanel code:
graphContainer = new AjaxLazyLoadPanel("graph_container") {
@Override
public Component getLazyLoadComponent(String markupId) {
return new ChartPanel(markupId, new ChartModel());
}
};
This is where the panel is inserted:
<div style="float: left;" wicket:id="graph_container"></div>
And panel (ChartPanel) html:
<wicket:panel>
<div style="float: left; width: 650px; margin-top: 10px;"
wicket:id="graph_container">
<img wicket:id="workflow_trend"></img>
</div>
</wicket:panel>
Thanks,
Rodrigo
Re: AjaxTabbedPanel, AjaxLazyLoadPanel and back button
Posted by Rodrigo De Castro <ro...@sacaluta.com>.
I solved this problem turning off the browser's cache for this page. So I
added the following override method and now it works just fine:
@Override
protected void configureResponse() {
super.configureResponse();
final WebResponse response = getWebRequestCycle().getWebResponse();
response.setHeader("Cache-Control", "no-cache, max-age=0,
must-revalidate, no-store");
}
Please let me know if there is another (better) solution.
Rodrigo
On Tue, Apr 28, 2009 at 7:14 PM, Rodrigo De Castro <ro...@sacaluta.com>wrote:
> Hey,
>
> I've been using AjaxTabbedPanel successfully, but ran into the following
> problem today:
>
> 1. Load page that has multiple tabs
> 2. Click on the second tab
> 3. Click on link on the tab panel that takes me to another page
> 4. Press back button
>
> It fails with the following error:
>
> WicketMessage: component
> tabpanel:mytabpanel:panel:general_workflow_panel:graph_container not found
> on page
>
> The container (graph_container) is an AjaxLazyLoadPanel. If I don't load it
> lazyly, it works fine. Is this a known bug? Or maybe I am not using
> AjaxLazyLoadPanel properly? Let me know if you need more information.
>
> AjaxLazyLoadPanel code:
> graphContainer = new AjaxLazyLoadPanel("graph_container") {
> @Override
> public Component getLazyLoadComponent(String markupId) {
> return new ChartPanel(markupId, new ChartModel());
> }
> };
>
> This is where the panel is inserted:
> <div style="float: left;" wicket:id="graph_container"></div>
>
> And panel (ChartPanel) html:
> <wicket:panel>
> <div style="float: left; width: 650px; margin-top: 10px;"
> wicket:id="graph_container">
> <img wicket:id="workflow_trend"></img>
> </div>
> </wicket:panel>
>
> Thanks,
> Rodrigo