[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-4382) s:selectItems doesn't reload when backing collection content changes

Christof Van Hove (JIRA) jira-events at lists.jboss.org
Mon Aug 24 15:33:41 EDT 2009


     [ https://jira.jboss.org/jira/browse/JBSEAM-4382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christof Van Hove updated JBSEAM-4382:
--------------------------------------

    Attachment: UISelectItems.java


If found a possible solution which seems to work for me(see the attached UISelectItems.java file )

I've changed the methods getValue() and asSelectItems() in a way that it returns an iterator over the backing collection itself instead of building an new collection. This looks like a more stable and efficient sollution to me.


Please have a look at this.

Best regards,

 Christof

> s:selectItems doesn't reload when backing collection content changes
> --------------------------------------------------------------------
>
>                 Key: JBSEAM-4382
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4382
>             Project: Seam
>          Issue Type: Bug
>          Components: JSF Controls
>    Affects Versions: 2.1.2.GA
>         Environment: Seam 2.1.2.GA / jdk1.6.0_14/ windows xp / jboss-5.1.0.GA
>            Reporter: Christof Van Hove
>         Attachments: UISelectItems.java
>
>
> links to the problem in the forum:
> http://seamframework.org/Community/SselectItemsDoesntReloadWhenObjectIsAddedToBackingCollection
> http://seamframework.org/Community/SselectItemsValueAttributeNotUpdated
> The selectItems only get updated if the reference to the backing collection changes:
> explanation  from Gena:
> ------------------------------------
> it's a bug the line 159 within the Method Object org.jboss.seam.ui.component.UISelectItems.getValue():
> Line 159: if (selectItems == null || originalValue == null || !originalValue.equals(super.getValue())) 
> and as you can see, originalValue.equals(super.getValue()) is always true as of implementation of AbstractList
> Line 479: AbstractList.equals  if (o == this) return true
> So if our base collection still be the same, selectItems doesn't refresh. And this occurs, if the selectItems was already initialized within the same request but with another count of elements (ie. for validate/convert the applied request values) there is no chance to refresh the selectItems unless recreating the collecion - so it's a bug. The new collection resolves the problem, because is not equals to cached one as of AbstractList contract.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list