Since we introduced Ajax we have two different means to associate Components and Markup. The "traditional" way which resolves the Component based on the wicket:id, and since this approach didn't work Ajax where we needed per Component render, the new approach resolves the Markup based on the Component id. The traditional approach (more specific the implementation of the approach) in Wicket is far more flexible and evolved than the new one and is able to handle situations which the new one can't. That will hopefully change soon, but until than I propose the following change:
The current code in Component basically disables all traditional resolvers which are more sofisticated than the new one, however as stated above the new approach is only used for AJAX components. Instead of throwing an exception if the new one doesn't find the markup, I'd much rather log a warning and go on as usual, as there is a high potential that the code still works. I had a several such examples in wicket-examples. Any objections? Juergen Component.java: public Component(MarkupContainer<?> parent, final String id, final IModel<T> model) { try { MarkupStream markupStream = MarkupFragmentFinder.find(this); ComponentTag tag = markupStream.getTag(); if (tag.hasAttributes()) { markupAttributes = new CopyOnWriteValueMap(tag.getAttributes()); } } catch (MarkupException ex) { log.warn("MarkupFragmentFinder was unable to find the markup associated with Component '" + id + "'. You will not be able to use the component for AJAX calls."); // throw ex; } catch (RuntimeException re) { log.warn("MarkupFragmentFinder was unable to find the markup associated with Component '" + id + "'. You will not be able to use the component for AJAX calls."); // throw new WicketRuntimeException("Couldn't find the markup of the component '" + id // + "' in parent " + parent.getPageRelativePath(), re); } parent.add(this); } ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Wicket-develop mailing list Wicket-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-develop