Hi, Check https://github.com/martin-g/blogs/tree/master/wicket6-resource-management This is the demo application for the article. It setups such FilteringHeaderResponse at https://github.com/martin-g/blogs/blob/master/wicket6-resource-management/src/main/java/com/wicketinaction/ResourceManagementApplication.java#L102
Martin Grigorov Wicket Training and Consulting On Fri, Jan 24, 2014 at 11:08 PM, Entropy <[email protected]> wrote: > I am still having this problem. The wicket:container solution leads me to > the following exception. Note that this exception is different than the > one > in the prior post. I think I had a publish/refresh quirk. This is the > exception that is occurring now. > > java.lang.IllegalStateException: No FilteringHeaderResponse is present in > the request cycle. This may mean that you have not decorated the header > response with a FilteringHeaderResponse. Simply calling the > FilteringHeaderResponse constructor sets itself on the request cycle > at > > org.apache.wicket.markup.head.filter.FilteringHeaderResponse.get(FilteringHeaderResponse.java:165) > at > > org.apache.wicket.markup.head.filter.HeaderResponseContainer.onComponentTagBody(HeaderResponseContainer.java:64) > at > > org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:71) > at > org.apache.wicket.Component.internalRenderComponent(Component.java:2549) > ... 80 more > > > > Entropy wrote > > Browser giving me a little trouble. Apologies if I double-submitted > this. > > My respoonse: > > > > I didn't even know such a website existed. Thanks. > > > > I am trying to implement the HeaderResponseContainer and filter > > suggestion. In my component I added the container: > > > > add(new HiddenField(INTERNAL_HIDDEN_ROWS_SELECTED, new > > > Model("")).setOutputMarkupId(true).setMarkupId(INTERNAL_HIDDEN_ROWS_SELECTED)); > > add(new HiddenField(INTERNAL_HIDDEN_COLUMN_SYNCH, new Model(""))); > > add(new HeaderResponseContainer("gridCode", "gridCodeFilter")); > > > > I added the HTML to my component (notice same level as those hiddens) > > <wicket:panel> > > > > <div class="enotes"> > > > > <input type="hidden" wicket:id="_gridRowsSelected" id="_gridRowsSelected" > > /> > > > > <input type="hidden" wicket:id="_gridColSynch" id="_gridColSynch" /> > > > > <div id="eNoteGrid"> > > </div> > > > > </div> > > > > <wicket:container wicket:id="gridCode" /> > > </wicket:panel> > > And in the renderHead I do: > > @Override > > public void renderHead(Component comp, IHeaderResponse response) { > > super.renderHead(comp, response); > > > > callbackUrl = behavior.getCallbackUrl().toString(); > > //JS > > response.render(JavaScriptHeaderItem.forReference(new > > JavaScriptResourceReference(ExtGrid.class, "ExtGridSupport.js"))); > > response.render(new > > FilteredHeaderItem(JavaScriptContentHeaderItem.forScript(writeGridJS(), > > getId() + "_js"), "gridCodeFilter")); > > } > > > > But I am getting: > > Failed to handle: > > <wicket:container wicket:id="gridCode"/> > > . It might be > > that no resolver has been registered to handle this special tag. But it > > also could be that you declared wicket:id=gridCode in your markup, but > > that > > you either did not add the component to your page at all, or that the > > hierarchy does not match. > > MarkupStream: [markup = > > > file:/C:/views/EquitShare_Development/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/AFMSShared/gov/usdoj/afms/shared/wicket/ext/grid/ExtGrid.html > > <wicket:panel> > > > > <div class="enotes"> > > > > <input type="hidden" wicket:id="_gridRowsSelected" > > id="_gridRowsSelected"/> > > > > <input type="hidden" wicket:id="_gridColSynch" id="_gridColSynch"/> > > > > <div id="eNoteGrid"> > > </div> > > > > </div> > > > > <wicket:container wicket:id="gridCode"/> > > </wicket:panel> > > , index = 6, current = ' > > <wicket:container > > wicket:id="gridCode"/> > > ' (line 0, column 0)] > > at > > > org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:526) > > at > > org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1409) > > at > org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1554) > > at > > > org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1529) > > at > > > org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:689) > > at > > > org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderAssociatedMarkup(AssociatedMarkupSourcingStrategy.java:76) > > at > > > org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy.onComponentTagBody(PanelMarkupSourcingStrategy.java:112) > > at > > org.apache.wicket.Component.internalRenderComponent(Component.java:2549) > > at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1493) > > at org.apache.wicket.Component.internalRender(Component.java:2379) > > at org.apache.wicket.Component.render(Component.java:2307) > > at > > org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1390) > > at > org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1554) > > at > > > org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1529) > > at > > > org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:689) > > at > > > org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderAssociatedMarkup(AssociatedMarkupSourcingStrategy.java:76) > > at > > > org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy.onComponentTagBody(PanelMarkupSourcingStrategy.java:112) > > at > > org.apache.wicket.Component.internalRenderComponent(Component.java:2549) > > at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1493) > > at org.apache.wicket.Component.internalRender(Component.java:2379) > > at org.apache.wicket.Component.render(Component.java:2307) > > at > > org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1390) > > at > org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1554) > > at > > > org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1529) > > at > > > org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:689) > > at > > > org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderAssociatedMarkup(AssociatedMarkupSourcingStrategy.java:76) > > at > > > org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy.onComponentTagBody(PanelMarkupSourcingStrategy.java:112) > > at > > org.apache.wicket.Component.internalRenderComponent(Component.java:2549) > > at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1493) > > at org.apache.wicket.Component.internalRender(Component.java:2379) > > at org.apache.wicket.Component.render(Component.java:2307) > > at > > org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1390) > > at > org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1554) > > at > > > org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1529) > > at > > > org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:689) > > at > > > org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderAssociatedMarkup(AssociatedMarkupSourcingStrategy.java:76) > > at > > > org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy.onComponentTagBody(PanelMarkupSourcingStrategy.java:112) > > at > > org.apache.wicket.Component.internalRenderComponent(Component.java:2549) > > at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1493) > > at org.apache.wicket.Component.internalRender(Component.java:2379) > > at org.apache.wicket.Component.render(Component.java:2307) > > at > > org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1390) > > at > org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1554) > > at org.apache.wicket.Page.onRender(Page.java:876) > > at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:142) > > at org.apache.wicket.Component.internalRender(Component.java:2379) > > at org.apache.wicket.Component.render(Component.java:2307) > > at org.apache.wicket.Page.renderPage(Page.java:1010) > > at > > > org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:121) > > at > > > org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:219) > > at > > > org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165) > > at > > > org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:861) > > at > > > org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) > > at > > > org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261) > > at > > > org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218) > > at > > > org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289) > > at > > > org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259) > > at > > > org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201) > > at > > > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282) > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Wicket-6-JavaScriptHeaderItem-renders-too-early-tp4663910p4663945.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
