You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Ralf Ebert (JIRA)" <ji...@apache.org> on 2008/12/13 22:52:44 UTC

[jira] Created: (WICKET-1978) ListMultipleChoice: Check for same list vs. list with equal elements

ListMultipleChoice: Check for same list vs. list with equal elements
--------------------------------------------------------------------

                 Key: WICKET-1978
                 URL: https://issues.apache.org/jira/browse/WICKET-1978
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4-RC1
            Reporter: Ralf Ebert


Since Wicket 1.4 ListMultipleChoice complains if a different list is present as model object in rendering and update because of ListMultipleChoice:319

			if (getDefaultModelObject() != 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!");
			}

IMO this is incorrect, because it suffices if some list with the exact same content (as defined by hashCode and equals) is provided. For example, I'm not able to reproduce the exact same list objects between requests, as the model objects are Hibernate query results which may not be kept across sessions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1978) ListMultipleChoice: Check for same list vs. list with equal elements

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12656690#action_12656690 ] 

Juergen Donnerstag commented on WICKET-1978:
--------------------------------------------

Could you please provide a patch and a test case. Thanks.


> ListMultipleChoice: Check for same list vs. list with equal elements
> --------------------------------------------------------------------
>
>                 Key: WICKET-1978
>                 URL: https://issues.apache.org/jira/browse/WICKET-1978
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-RC1
>            Reporter: Ralf Ebert
>
> Since Wicket 1.4 ListMultipleChoice complains if a different list is present as model object in rendering and update because of ListMultipleChoice:319
> 			if (getDefaultModelObject() != 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!");
> 			}
> IMO this is incorrect, because it suffices if some list with the exact same content (as defined by hashCode and equals) is provided. For example, I'm not able to reproduce the exact same list objects between requests, as the model objects are Hibernate query results which may not be kept across sessions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-1978) ListMultipleChoice: Check for same list vs. list with equal elements

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-1978.
-----------------------------------

    Resolution: Won't Fix
      Assignee: Igor Vaynberg

this check happens within the same request, not across requests. basically it is a check that makes sure the same instance of list is used throughout the entire updatemodel() call.

if you have a model { getobject() { return new list(); }} then changes to the old list instance will not take affect because the component modifies the instance of list it retrieved from the first call.

using a loadable detachable model should alleviate this problem.

> ListMultipleChoice: Check for same list vs. list with equal elements
> --------------------------------------------------------------------
>
>                 Key: WICKET-1978
>                 URL: https://issues.apache.org/jira/browse/WICKET-1978
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-RC1
>            Reporter: Ralf Ebert
>            Assignee: Igor Vaynberg
>
> Since Wicket 1.4 ListMultipleChoice complains if a different list is present as model object in rendering and update because of ListMultipleChoice:319
> 			if (getDefaultModelObject() != 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!");
> 			}
> IMO this is incorrect, because it suffices if some list with the exact same content (as defined by hashCode and equals) is provided. For example, I'm not able to reproduce the exact same list objects between requests, as the model objects are Hibernate query results which may not be kept across sessions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.