[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-1801) Add attribute to <s:selectItems> allowing arbitrary values to be used as form "value"'s

Pete Muir (JIRA) jira-events at lists.jboss.org
Tue Nov 6 07:24:44 EST 2007


     [ http://jira.jboss.com/jira/browse/JBSEAM-1801?page=all ]

Pete Muir closed JBSEAM-1801.
-----------------------------

    Fix Version/s: 2.0.1.GA
       Resolution: Done

I've implemented something similar: override and extend the org.jboss.seam.ui.entityIdentiferStore component implementing the get and put methods.  You can then use e.g. a HashMap, and using the identifier and entity arguements to put, store it under whatever key you like

> Add attribute to <s:selectItems> allowing arbitrary values to be used as form "value"'s
> ---------------------------------------------------------------------------------------
>
>                 Key: JBSEAM-1801
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1801
>             Project: JBoss Seam
>          Issue Type: Feature Request
>          Components: JSF
>    Affects Versions: 2.0.0.BETA1
>            Reporter: Matthew Lieder
>         Assigned To: Pete Muir
>             Fix For: 2.0.1.GA
>
>
> Say we have the following:
> <h:selectOneMenu value="#{curPerson.favoritePerson}">
>   <s:selectItems value="#{people}" var="person" label="#{person.fullName}" />
> </h:selectOneMenu>
> The problem is that when the form is submitted, the value of "person.toString()" is stored in curPerson.favoritePerson. In some situations that might be acceptable, but not if the class doesn't have a guaranteed unique toString implementation. In this specific example, person.SSN would be the wanted field.
> To solve this problem, I recommend adding an "index" attribute functioning like the "label" attribute, except that the evaluated value is used for the "value" attribute in the generated HTML (the value that is submitted by the form). Should be pretty easy, I'm guessing?

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

        



More information about the seam-issues mailing list