Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Cannot Reproduce
-
None
-
None
-
wicket build from svn trunk revision 540588
Description
Problem description copied from the mailing list:
After upgrading from wicket 1.3 beta 1 to a build based on revision 540588, I get the following error message:
18:49:19.245 [btpool0-2] ERROR org.apache.wicket.RequestCycle - The
component(s) below failed to render. A common problem is that you have
added a component in code but forgot to reference it in the markup
(thus the component will never be rendered).
1. [MarkupContainer [Component id = progressBarStylesheet, page =
org.xoocode.xooctory.web.pages.dashboard.Dashboard, path =
2:projects-panel:projects:6:leftTimePanel:progressBar:progressBarStylesheet.StyleSheetReference,
isVisible = true, isVersioned = false]]
The problem is that the component is properly added, and it worked
before upgrading, so...
So I've tried to track down the problem, and I've not found the source
of the problem. As a workaround I disable check rendering with:
getDebugSettings().setComponentUseCheck(false);
Then everything works properly, and the component (a style sheet) is
properly rendered.
Let me explain a little bit more the situation in which the problem occurs.
The component which is causing the problem is a StyleSheetReference
added to a panel. The markup contains the corresponding link in a
wicket:head section.
The panel is invisible when the page is loaded, but then I use an ajax
link to trigger an action, which later triggers the visibility of this
component to true. Then this component is refreshed by an AjaxTimer
(actually I use wicket-contrib-push, but I don't think it really makes
a difference, since it's using a simple AbstractAjaxTimerBehavior
underneath). And that's when the component is rendered that the check
rendering is failing. Some analysis shown that there's a
StyleSheetReference with the good id in the renderedComponent
attribute of Page, but it isn't the exact same StyleSheetReference
instance as the one checked by the checkRendering method. For the
moment I haven't managed to really see why I have two instances, what
doesn't help is that it seems that when I debug, the problem goes away
depending on the occurence of other timer based ajax requests.
For more details the sources are available here:
ProgressBar.java
http://www.xoocode.org/wsvn/xoocode/org.xoocode.xooctory/trunk/xooctory/src/main/java/org/xoocode/xooctory/web/component/ProgressBar.java?op=file&rev=189&sc=0
ProgressBar.html
http://www.xoocode.org/wsvn/xoocode/org.xoocode.xooctory/trunk/xooctory/src/main/java/org/xoocode/xooctory/web/component/ProgressBar.html?op=file&rev=166&sc=0