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 <[EMAIL PROTECTED]> 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, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 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);
>                 }
>         }
> }
>
>
>

Reply via email to