Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-930

tr:selectOneChoice resets value if not in form

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.2.6-core
    • 1.2.10-core, 1.0.10-core
    • Components
    • None
    • JSF RI 1.2, Trinidad 1.2 trunk

    Description

      If tr:selectOneChoice is outside a h:form, it resets value used in value="#{}". Test case:

      JSP snippet:

      <tr:selectOneChoice value="#

      {testBean.property}

      " unselectedLabel="(not selected)">
      <f:selectItem itemValue="value1" itemLabel="Item 1"/>
      </tr:selectOneChoice>

      <h:form> <!-- tr:selectOneChoice is not in the form -->
      <h:commandButton value="Ok" />
      </h:form>

      managed bean in session scope:

      public class TestBean {

      private String property = "value1";

      public String getProperty()

      { return property; }

      public void setProperty(String property)

      { this.property = property; }

      }

      Steps to reproduce problem:
      1) Display jsp page - it shows "Item 1" in combobox
      2) Click on "Ok" button
      3) Value in combobox will change to "(not selected)"

      Attachments

        1. SimpleSelectOneRenderer.java.patch
          0.7 kB
          Martin Kočí

        Activity

          People

            matzew Matthias Wessendorf
            markoc50 Martin Kočí
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: