You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2007/04/06 01:58:37 UTC
svn commit: r526006 -
/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
Author: ivaynberg
Date: Thu Apr 5 16:58:37 2007
New Revision: 526006
URL: http://svn.apache.org/viewvc?view=rev&rev=526006
Log:
make sure model.setobject() is always called. some models convert between types inside, and so even if a collection has been reused a setobject() must be called
Modified:
incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java?view=diff&rev=526006&r1=526005&r2=526006
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java Thu Apr 5 16:58:37 2007
@@ -290,11 +290,12 @@
selectedValues.clear();
selectedValues.addAll((Collection)getConvertedInput());
modelChanged();
+ getModel().setObject(selectedValues);
}
else
{
selectedValues = (Collection)getConvertedInput();
- setModelObject(selectedValues);
+ getModel().setObject(selectedValues);
}
}
}
Re: svn commit: r526006 - /incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
Posted by Igor Vaynberg <ig...@gmail.com>.
now is a better time because after model refactor models are better suited
for this. and yes, we already broke compatibility, so it shouldnt be that
big a deal.
-igor
On 4/6/07, Jean-Baptiste Quenot <jb...@apache.org> wrote:
>
> What is the reason why you do this change now and not before when
> we discussed it last year? Is it because we are already breaking
> many things for 1.3?
> --
> Jean-Baptiste Quenot
> aka John Banana Qwerty
> http://caraldi.com/jbq/
>
Re: svn commit: r526006 - /incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
Posted by Johan Compagner <jc...@gmail.com>.
we don't really break anything. We fix a long outstanding bug (i think that
bug is even reported on the sourceforge site)
as igor said in 1.2 we couldn't do this because we had to work through
setModelObject of the component itself (because of compounds)
now with the model refactor we can call directly: getModel().setObject() so
now it can work as it should work.
johan
On 4/6/07, Jean-Baptiste Quenot <jb...@apache.org> wrote:
>
> What is the reason why you do this change now and not before when
> we discussed it last year? Is it because we are already breaking
> many things for 1.3?
> --
> Jean-Baptiste Quenot
> aka John Banana Qwerty
> http://caraldi.com/jbq/
>
Re: svn commit: r526006 - /incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
Posted by Jean-Baptiste Quenot <jb...@apache.org>.
What is the reason why you do this change now and not before when
we discussed it last year? Is it because we are already breaking
many things for 1.3?
--
Jean-Baptiste Quenot
aka John Banana Qwerty
http://caraldi.com/jbq/
Re: svn commit: r526006 - /incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
Posted by Igor Vaynberg <ig...@gmail.com>.
would you please?
i think we should look over the components and for the ones that work on
collections or compound objects we should make sure we always call setobject
eventhough the reference hasnt changed.
that way we ensure that models work properly because i find it a common
pattern that i use imodel as a listener and do some interesting things in
get/set calls.
-igor
On 4/6/07, Johan Compagner <jc...@gmail.com> wrote:
>
> now we do set it back in we could remove this exception i guess:
>
> if (getModelObject() != selectedValues)
> throw new WicketRuntimeException(
> "Updating a ListMultipleChoice works by modifying
> the underlying model object in-place, so please make sure that getObject()
> always returns the same Collection instance!");
>
>
>
>
> On 4/6/07, ivaynberg@apache.org <iv...@apache.org> wrote:
> >
> > Author: ivaynberg
> > Date: Thu Apr 5 16:58:37 2007
> > New Revision: 526006
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=526006
> > Log:
> > make sure model.setobject() is always called. some models convert
> between
> > types inside, and so even if a collection has been reused a setobject()
> must
> > be called
> >
> > Modified:
> > incubator/wicket/branches/wicket-1.x/jdk-1.4
> > /wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
> >
> > Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4
> > /wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
> > URL:
> >
> http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java?view=diff&rev=526006&r1=526005&r2=526006
> >
> >
> ==============================================================================
> > --- incubator/wicket/branches/wicket-1.x/jdk-1.4
> /wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
> > (original)
> > +++ incubator/wicket/branches/wicket-1.x/jdk-1.4
> /wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
> > Thu Apr 5 16:58:37 2007
> > @@ -290,11 +290,12 @@
> > selectedValues.clear();
> > selectedValues.addAll
> > ((Collection)getConvertedInput());
> > modelChanged();
> > + getModel().setObject(selectedValues);
> > }
> > else
> > {
> > selectedValues =
> (Collection)getConvertedInput();
> > - setModelObject(selectedValues);
> > + getModel().setObject(selectedValues);
> > }
> > }
> > }
> >
> >
> >
>
Re: svn commit: r526006 - /incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
Posted by Johan Compagner <jc...@gmail.com>.
now we do set it back in we could remove this exception i guess:
if (getModelObject() != selectedValues)
throw new WicketRuntimeException(
"Updating a ListMultipleChoice works by modifying
the underlying model object in-place, so please make sure that getObject()
always returns the same Collection instance!");
On 4/6/07, ivaynberg@apache.org <iv...@apache.org> wrote:
>
> Author: ivaynberg
> Date: Thu Apr 5 16:58:37 2007
> New Revision: 526006
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=526006
> Log:
> make sure model.setobject() is always called. some models convert between
> types inside, and so even if a collection has been reused a setobject() must
> be called
>
> Modified:
> incubator/wicket/branches/wicket-1.x/jdk-1.4
> /wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
>
> Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4
> /wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
> URL:
> http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java?view=diff&rev=526006&r1=526005&r2=526006
>
> ==============================================================================
> --- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
> (original)
> +++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/ListMultipleChoice.java
> Thu Apr 5 16:58:37 2007
> @@ -290,11 +290,12 @@
> selectedValues.clear();
> selectedValues.addAll
> ((Collection)getConvertedInput());
> modelChanged();
> + getModel().setObject(selectedValues);
> }
> else
> {
> selectedValues = (Collection)getConvertedInput();
> - setModelObject(selectedValues);
> + getModel().setObject(selectedValues);
> }
> }
> }
>
>
>