Hi Michael,
On Thu, Dec 13, 2012 at 11:36 PM, Michael Mosmann <[email protected]>wrote: > Hi, > > .. maybe someone has a better idea. What's the problem. > > One can add a behavior to a component which implements > IAjaxRegionMarkupIdProvider. This way it's very easy to include some > content rendered by this behavior even in an ajax-response (see > http://www.wicket-praxis.de/**blog/2011/05/18/wicket-ajax-** > iajaxregionmarkupidprovider/<http://www.wicket-praxis.de/blog/2011/05/18/wicket-ajax-iajaxregionmarkupidprovider/>(german > only)). But if the component is invisible, the behavior is not > called except the IAjaxRegionMarkupIdProvider call. > > So whatever the behavior does in beforeRender()/afterRender() (wicket > 1.5.x), it will not be asked again, except for the markup id. > > Ok.. some examples: > > <body> > <wicket:container wicket:id="panel"></wicket:**container> > </body> > > could be rendered to (if visible): > > <body> > <div id="panel1_mybehavior"> > <wicket:container id="panel1" wicket:id="panel"></wicket:** > container> > </div> > </body> > > but will be rendered to (if invisible (**setOutputMarkupPlaceholderTag(** > true)): > > <body> > <wicket:container id="panel1" wicket:id="panel" > style="display:none"></wicket:**container> > I think a warning log message is logged when the application code tries to set a markup id for a ComponentTag which wont be rendered, like <wicket:container> or any HTML element connected to a Java Component with #setRenderBodyOnly(true). This warning tells you that there is something wrong. > </body> > > which is in production should simply this: > > <body> > > </body> > > but is (Bug in renderPlaceholderTag?) > > <body> > <wicket:container id="panel1" style="display:none"></wicket:** > container> > </body> > > Ok. Here is what i would like to achive: > - you can update a component via ajax no matter which tag the component is > bound > By default Wicket removes all <wicket:xyz> elements in production mode, so it is not possible later to replace a non-existing element :-/ > - it should work with invisible components > - i would like to avoid any additional WebMarkupContainer > I think the solution to your problem is to avoid using <wicket:container>. <wicket:container> is a shortcut of <div> + a Component with #setRenderBodyOnly(true). So just use a <div> instead and all should be good. > > Any idea? > It is a bug (wicket 1.5.9 - i can do a quickstart)? > > thank you:) > Michael > > > > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com <http://jweekend.com/>
