I did find the behavior handy, but it is easy to work around. D/
On Dec 12, 2009, at 11:12 PM, Igor Vaynberg wrote: > i think you guys misunderstand. > > i believe what we are talking about here is the requirement for > presence of components *other* then the component specified by > enclosure's child attribute. > > essentially if i do this: > > add(new webmarkupcontainer("container").setvisible(false)); > and have this in my markup: > <div wicket:id="container"><div wicket:id="foo"/></div> > > wicket will not throw an error even though i never added the "foo" > component to my component hierarchy because as soon as it determins > that the container div is not visible it will skip over until the > closing tag. > > the enclosures, however, as of 1.4.4 *will* throw an error for *any* > missing child declared inside enclosure's markup *even though* the > enclosure has been determined as hidden. > > hope this clears it up somewhat > > -igor > > > > On Sat, Dec 12, 2009 at 5:18 PM, Jason Lea <ja...@kumachan.net.nz> wrote: >> From the description of the tag >> http://cwiki.apache.org/WICKET/wickets-xhtml-tags.html I think the 1.4.4 >> behavior would be correct, and if the example Vadim provided used to work it >> would be due to a bug. >> The attribute on the tag makes it clear it is a 'child' otherwise it would >> have been named 'randomWicketId' :) >> >> The tag is really a case of (limited) conditional markup which I think we >> want the framework to stay away from. If there was a vote to expand the >> behavior, then perhaps it should also move out of the core to wicket >> extensions (if such a thing is possible). >> >> Igor Vaynberg wrote: >>> >>> hrm, already two people stumbled into this. i was of the mind that the >>> way it works now is the correct behavior, but i am starting to think >>> maybe i was incorrect... >>> >>> -igor >>> >>> On Sat, Dec 12, 2009 at 12:39 PM, Vadim Tesis <vad...@hotmail.com> wrote: >>> >>>> >>>> all, >>>> >>>> >>>> >>>> i just migrated to 1.4.4 from 1.4.3 and looks like enclosure >>>> functionality changed. if enclosure doesn't have child element in it, it >>>> throws exception. >>>> >>>> for example following code works in 1.4.3 >>>> >>>> >>>> >>>> ... >>>> >>>> <wicket:enclosure child="link"> >>>> <div>...</div> >>>> </wicket:enclosure> >>>> <a href="#" wicket:id="link">...</a> >>>> >>>> ... >>>> >>>> >>>> >>>> but in 1.4.4 it throws exception (see below). >>>> >>>> is 1.4.4 functionality correct or 1.4.3? >>>> >>>> >>>> >>>> Thanks, >>>> >>>> Vadim >>>> >>>> >>>> >>>> >>>> [#|2009-12-12T12:54:04.546-0500|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=20;_ThreadName=httpSSLWorkerThread-80-0;|12:54:04,546 >>>> ERROR org.apache.wicket.RequestCycle - Exception in rendering component: >>>> [MarkupContainer [Component id = enclosure-205]] >>>> org.apache.wicket.WicketRuntimeException: Exception in rendering >>>> component: [MarkupContainer [Component id = enclosure-205]] >>>> at org.apache.wicket.Component.renderComponent(Component.java:2656) >>>> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) >>>> at org.apache.wicket.Component.render(Component.java:2448) >>>> at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229) >>>> at >>>> org.apache.wicket.markup.resolver.EnclosureResolver.resolve(EnclosureResolver.java:61) >>>> at >>>> org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81) >>>> at >>>> org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1418) >>>> at >>>> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577) >>>> at >>>> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501) >>>> at org.apache.wicket.Component.renderComponent(Component.java:2617) >>>> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) >>>> at org.apache.wicket.Component.render(Component.java:2448) >>>> at >>>> org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414) >>>> at >>>> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577) >>>> at >>>> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501) >>>> at >>>> org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:1936) >>>> at org.apache.wicket.Component.renderComponent(Component.java:2617) >>>> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) >>>> at org.apache.wicket.markup.html.form.Form.onRender(Form.java:2007) >>>> at org.apache.wicket.Component.render(Component.java:2448) >>>> at >>>> org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414) >>>> at >>>> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577) >>>> at >>>> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501) >>>> at org.apache.wicket.Component.renderComponent(Component.java:2617) >>>> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) >>>> at org.apache.wicket.Component.render(Component.java:2448) >>>> at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229) >>>> at >>>> org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:66) >>>> at >>>> org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81) >>>> at >>>> org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1418) >>>> at >>>> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577) >>>> at >>>> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501) >>>> at org.apache.wicket.Component.renderComponent(Component.java:2617) >>>> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) >>>> at org.apache.wicket.Component.render(Component.java:2448) >>>> at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229) >>>> at >>>> org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:73) >>>> at >>>> org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81) >>>> at >>>> org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1418) >>>> at >>>> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577) >>>> at >>>> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501) >>>> at org.apache.wicket.Component.renderComponent(Component.java:2617) >>>> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) >>>> at org.apache.wicket.Component.render(Component.java:2448) >>>> at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229) >>>> at >>>> org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:66) >>>> at >>>> org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81) >>>> at >>>> org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1418) >>>> at >>>> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577) >>>> at >>>> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501) >>>> at org.apache.wicket.Component.renderComponent(Component.java:2617) >>>> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) >>>> at org.apache.wicket.Component.render(Component.java:2448) >>>> at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229) >>>> at >>>> org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:73) >>>> at >>>> org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81) >>>> at >>>> org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1418) >>>> at >>>> org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1528) >>>> at org.apache.wicket.Page.onRender(Page.java:1545) >>>> at org.apache.wicket.Component.render(Component.java:2448) >>>> at org.apache.wicket.Page.renderPage(Page.java:914) >>>> at >>>> org.apache.wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:167) >>>> at >>>> org.apache.wicket.request.target.coding.HybridUrlCodingStrategy$HybridBookmarkablePageRequestTarget.respond(HybridUrlCodingStrategy.java:904) >>>> at >>>> org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105) >>>> at >>>> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258) >>>> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) >>>> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) >>>> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) >>>> at >>>> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) >>>> at >>>> org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138) >>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) >>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) >>>> at >>>> org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427) >>>> at >>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:333) >>>> at >>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) >>>> at >>>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) >>>> at >>>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) >>>> at >>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) >>>> at >>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) >>>> at >>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313) >>>> at >>>> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287) >>>> at >>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218) >>>> at >>>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) >>>> at >>>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) >>>> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) >>>> at >>>> com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98) >>>> at >>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222) >>>> at >>>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) >>>> at >>>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) >>>> at >>>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587) >>>> at >>>> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096) >>>> at >>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166) >>>> at >>>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) >>>> at >>>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) >>>> at >>>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587) >>>> at >>>> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096) >>>> at >>>> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288) >>>> at |#] >>>> >>>> >>>> [#|2009-12-12T12:54:04.546-0500|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=20;_ThreadName=httpSSLWorkerThread-80-0;|com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647) >>>> at >>>> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579) >>>> at >>>> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831) >>>> at >>>> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341) >>>> at >>>> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263) >>>> at >>>> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214) >>>> at >>>> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) >>>> at >>>> com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106) >>>> Caused by: java.lang.NullPointerException >>>> at >>>> org.apache.wicket.markup.html.internal.DirectChildTagIterator.findNext(DirectChildTagIterator.java:109) >>>> at >>>> org.apache.wicket.markup.html.internal.DirectChildTagIterator.next(DirectChildTagIterator.java:80) >>>> at >>>> org.apache.wicket.markup.html.internal.Enclosure.ensureAllChildrenPresent(Enclosure.java:236) >>>> at >>>> org.apache.wicket.markup.html.internal.Enclosure.onComponentTagBody(Enclosure.java:169) >>>> at org.apache.wicket.Component.renderComponent(Component.java:2617) >>>> ... 104 more >>>> >>>> >>>> _________________________________________________________________ >>>> Hotmail: Trusted email with powerful SPAM protection. >>>> http://clk.atdmt.com/GBL/go/177141665/direct/01/ >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> >> >> -- >> Jason Lea >> >> >> > > --------------------------------------------------------------------- > 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