Hi, Put a breakpoint at org.apache.wicket.Component#internalBeforeRender, in the second 'if' clause that throws this exception. This way you can see details about the problematic component - like its type, its id, its parents, etc. This way you should be able to identify which parent class doesn't call super.onBeforeRender()
On Sun, Jan 27, 2013 at 5:53 PM, Pierre Goupil <[email protected]>wrote: > Good afternoon, > > In my project I got this exception from times to times: > > Last cause: org.apache.wicket.Component has not been properly rendered. > Something in the hierarchy of blah.ExternalImage has not called > super.onBeforeRender() in the override of onBeforeRender() method > WicketMessage: Error attaching this container for rendering: > [WebMarkupContainer [Component id = wrapper]] > > This occurs during an Ajax update. > > What puzzles me is: > > - that it doesn't occur every time, only now and then > - and that I never override onBeforeRender() in my code, neither in > ExternalImage > nor everywhere else. > > Here is my code for ExternalImage, just in case: > > public class ExternalImage extends WebComponent > { > private static final long serialVersionUID = 1L; > > public ExternalImage(final String id, final String imageUrl) > { > super(id); > this.add(AttributeModifier.replace("src", new Model<String>(imageUrl))); > this.setVisible(!((imageUrl == null) || imageUrl.equals(""))); > } > > @Override > protected void onComponentTag(final ComponentTag tag) > { > super.onComponentTag(tag); > this.checkComponentTag(tag, "img"); > } > > } > > Regarding my wrapper component ([Component id = wrapper] in the exception), > it's pretty straightforward: > > final WebMarkupContainer wrapper = new WebMarkupContainer("wrapper"); > wrapper.setMarkupId("wrapper" + item.getIndex()); > wrapper.setOutputMarkupId(true); > > I've googled around without any success, so if anyone has an idea, I'd be > more than happy! :-) > > Regards, > > Pierre Goupil > > > -- > "Parce que c'est la nuit qu'il est beau de croire à la lumière." > > Edmond Rostand > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com <http://jweekend.com/>
