Uploaded image for project: 'Stripes'
  1. STS-876

options-collection doesn't use in label the item if empty

    Details

    • Sprint:

      Description

      In an option collection, you can specify the value and the label, which will be used to create the <option value="value">label</option>.

      So if you want to use a field of each item, is good, but if you try to let the item be used as label and value, by not specifying it:

      <stripes:options-collection collection="$

      {actionBean.seasons}"/>
      In my case will output:
      <select name="event.season">
      <option value="2011 - Verano">org.lmb97.data.Seasons@468c4a4f</option>
      </select>

      Which is nearly correct, value is set using the custom formatter for Seasons class. But the value and the label should be the same.

      Neither if you specify value, and let the other use the Class formatter:

      <stripes:options-collection collection="${actionBean.seasons}

      " value="id" />
      Which outputs:
      <select name="event.season">
      <option selected="selected" value="1">org.lmb97.data.Seasons@36088e42</option>
      </select>

      The label isn't what it should be, as label should be using the Formatter and not toString().

        Attachments

          Activity

            People

            • Assignee:
              rgrashel Rick Grashel
              Reporter:
              txomon txomon
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: