looks fine to me.
maybe only if optimizedremoveal or something is true then it can go wrong?
But what does it do if the model object is changed? Because the behavior
must be exactly the same.

johan


On 4/20/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:

the following is my fix to WICKET-349

Index: D:/source/wicket/wicket-1.2.x
/wicket/src/main/java/wicket/markup/html/list/ListView.java
===================================================================
--- D:/source/wicket/wicket-1.2.x
/wicket/src/main/java/wicket/markup/html/list/ListView.java
(revision 524357)
+++ D:/source/wicket/wicket-1.2.x
/wicket/src/main/java/wicket/markup/html/list/ListView.java
(working copy)
@@ -498,10 +498,6 @@
      */
     public Component setModel(IModel model)
     {
-        // remove all children; this has no effect when the list
-        // didn't render before, as in that case the list view
-        // does not yet have any children
-        removeAll();
         return super.setModel(model);
     }

maybe someone can tell me if they think it will break something. i really
dont see the point of that removeAll().

a) all the items are removed in internalonattach() which is called before
render
b) this removeAll() only makes sense if setmodel() is called between
internalOnAttach() and render() which doesnt make sense
c) even if setmodel() is called in that gap all this does is remove the
entries, but since they are recreated in internalOnAttach() the listview
will render empty???

so that removeAll() never made sense in there in the first place.

did i miss something?

-igor

  • WICKET-349 Igor Vaynberg
    • Re: WICKET-349 Johan Compagner

Reply via email to