I (partially) disagree. Invoking removeAll() should be equivilent to invoking remove() on all children individually -- assuming no subclassing has occured. removeAll() might be more efficient, but if it doesn't get the job done what's the point? If subclassing has entered into the discussion then both remove() and removeAll() will have to be subclassed as a team (similar to hashCode() and equals()).

Gili

Igor Vaynberg wrote:
i do not think removeAll() should call the regular remove(). removeAll() generates a single change object and clears out the children, i think that is enough. it does what it says in a simple and efficient way.

-Igor


On 12/28/05, *Juergen Donnerstag* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    I tried to fix it, but may be someone with better knowledge of state
    changes should do it. We can not just iterate over the children and
    call remove() because than we would record the state change twice.
    remove() currently does much more than just setParent(null).
    Functionality which removeAll() does not have. But removeAll() uses a
    more efficient state change as it remembers the list containing all
    children. Iterating all children and registering a state change for
    each child is certainly less efficient.

    Juergen

     >On 12/28/05, Juergen Donnerstag <[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>> wrote:
     > No. I think you are right. We probably changed remove() sometimes
     > later on and didn't look at removeAll(). removeAll() should call
     > remove() for each child.
     >
     > Juergen
     >
     >
     > On 12/28/05, Laurent PETIT < [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>> wrote:
     > > Thanks for the quick answer.
     > >
     > > I've digged a little bit in the code, because now that I know what
     > > you've done to suppress the bug, I think the initial idea was
     > > interesting (throwing the exception).
     > >
     > > I saw that the bug occurs because OrderedRepeatingView calls
     > > super.removeAll() (i.e. MarkupContainer.removeAll()).
     > >
     > > And the problem is that MarkupContainer.removeAll() does not at all
     > > call remove() on each of its children ==> every children components
     > > keeps the pointer to its parent component.
     > >
     > > The "clean" solution would be to correct the
     > > MarkupContainer.removeAll() method. But it has maybe been done this
     > > way (just setting the children property to null) for performance
     > > reasons ?
     > >
     > >
     > >
     > >
     > > On 12/28/05, Igor Vaynberg <[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>> wrote:
     > > > this was due to a new check we introduced. basically it would
    throw an error
     > > > if you try to add a component that already had a parent set.
    this would help
     > > > users catch errors in certain situtations, but obviously
    caused problems in
     > > > others.
     > > >
     > > > i changed it so now the component is removed from its
    previous parent before
     > > > it is added to its new one instead of throwing an error if a
    parent was
     > > > already set.
     > > >
     > > > -Igor
     > > >
     > > >
     > > >
     > > >  On 12/27/05, Laurent PETIT <[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>> wrote:
     > > > >
     > > > > Hello,
     > > > >
     > > > > While testing my strutsnested example before commiting it,
    I had the
     > > > > good idea to do an update (had not done one for a while,
    may be a week
     > > > > or more).
     > > > >
     > > > > My example now scratches.
     > > > >
     > > > > I investigated a little bit, and it appears that the
    wicket-example
     > > > > related to the ReuseIfModelsEqualStrategy also fails (the
     > > > >
     > > >
    
http://localhost:8080/wicket-examples/repeater?bookmarkablePage=wicket.examples.repeater.OIRPage
     > > > > link)
     > > > >
     > > > > Don't know where the problem lies.
     > > > >
     > > > > regards,
     > > > >
     > > > > --
     > > > > laurent
     > > > >
     > > > >
     > > > > -------------------------------------------------------
     > > > > This SF.net email is sponsored by: Splunk Inc. Do you grep
    through log
     > > > files
     > > > > for problems?  Stop!  Download the new AJAX search engine
    that makes
     > > > > searching your log files as easy as surfing
    the  web.  DOWNLOAD SPLUNK!
     > > > > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
    <http://ads.osdn.com/?ad_idv37&alloc_id865&opclick>
     > > > > _______________________________________________
     > > > > Wicket-user mailing list
     > > > > Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
     > > > > https://lists.sourceforge.net/lists/listinfo/wicket-user
     > > > >
     > > >
     > > >
     > >
     > >
     > > -------------------------------------------------------
     > > This SF.net email is sponsored by: Splunk Inc. Do you grep
    through log files
     > > for problems?  Stop!  Download the new AJAX search engine that
    makes
     > > searching your log files as easy as surfing the  web.  DOWNLOAD
    SPLUNK!
     > > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
    <http://ads.osdn.com/?ad_idv37&alloc_id865&opclick>
     > > _______________________________________________
     > > Wicket-user mailing list
     > > Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
     > > https://lists.sourceforge.net/lists/listinfo/wicket-user
    <https://lists.sourceforge.net/lists/listinfo/wicket-user>
     > >
     >


    -------------------------------------------------------
    This SF.net email is sponsored by: Splunk Inc. Do you grep through
    log files
    for problems?  Stop!  Download the new AJAX search engine that makes
    searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
    http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
    <http://ads.osdn.com/?ad_idv37&alloc_id865&opclick>
    _______________________________________________
    Wicket-user mailing list
    Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/wicket-user
    <https://lists.sourceforge.net/lists/listinfo/wicket-user>



--
http://www.desktopbeautifier.com/


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to