Hi, thanks, sorry about silly question I forgot that java passes method arguments by value and copies references. Maybe I got confused with c++ pointers.
Regards, -- Marek Šabo On 01/21/2010 03:48 PM, Alexander Monakhov wrote: > Hi. > > I'm not sure. But when you call add() method you pass reference to the > certain component. If you create new object and assign reference to it, you > just create reference to new object, but old one references to old object. > For example, > > // here is new component creation > 1. Component c = new Component( .... ); > 2. add( c );// add to component tree > > 3. c = new Component( .. );//initialize another component > 4. replaceWith( c );// replace old component with new one > > if are you asking why sould 4th lines be invoked, the question is simple, > you have to push reference to new component to component tree. If you are > why doesn't it work with out 4th, try to read about references in Java. > > Best regards, Alexander. > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org