Re: The "better" way tp add component directly
AbstractRepeater (and its subclasses) does it this way with its onPopulate() method, so this strategy should fit your case too. Perhaps think about a reuse strategy, i.e. don't create a new component if the type hasn't changed. Sven -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/The-better-way-tp-add-component-directly-tp2122805p2123830.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: The "better" way tp add component directly
Hi Eyal, I think that the best time to execute this code is inside the Ajax callback method. Perhaps you'll need to set up some kind of notification (event) mechanism. Regards, Erik. Op 02-05-10 16:25, Eyal Golan schreef: actually we do call the addOrReplace method (I copied it incorrectly). However, the question remains, is there a different way of doing it other than in the onBeforeRender ? Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary 2010/5/2 Uwe Schäfer Am 02.05.2010 15:44, schrieb Eyal Golan: The Main (parent) panel can be changed via ajax. The ajax might change the enum type. if you change it at runtime, would you not want to replace, instead of add? cu uwe -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: The "better" way tp add component directly
actually we do call the addOrReplace method (I copied it incorrectly). However, the question remains, is there a different way of doing it other than in the onBeforeRender ? Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary 2010/5/2 Uwe Schäfer > Am 02.05.2010 15:44, schrieb Eyal Golan: > > > The Main (parent) panel can be changed via ajax. The ajax might change the >> enum type. >> > > if you change it at runtime, would you not want to replace, instead of add? > > cu uwe > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: The "better" way tp add component directly
Am 02.05.2010 15:44, schrieb Eyal Golan: The Main (parent) panel can be changed via ajax. The ajax might change the enum type. if you change it at runtime, would you not want to replace, instead of add? cu uwe - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
The "better" way tp add component directly
Hello, I have a situation that I am adding to Panel a Component. This component can actually be of several other panels (there's a factory that returns the correct Panel according to an enum). The Main (parent) panel can be changed via ajax. The ajax might change the enum type. In order to solve it, I am adding the specific (inner) panel in the onBeforeRender method: @Override protected void onBeforeRender() { Component component = myFactory.createSpecificCompnent("myComp", enumValue); add(component); } Is this the best and correct way doing that? Thanks, Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary