Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-1801

Add attribute to <s:selectItems> allowing arbitrary values to be used as form "value"'s

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.0.0.BETA1
    • Fix Version/s: 2.0.1.CR1
    • Component/s: JSF Integration
    • Labels:
      None

      Description

      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?

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  pmuir Pete Muir
                  Reporter:
                  IGx89 Matthew Lieder (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: