javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-87

Unexpected behaviour with disabled selectOneMenu

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1_01
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      87

      Description

      If I have a disabled selectOneMenu and I attempt to submit the form that menu
      belongs to then a null value is sent to my value bound backing bean. If I
      disable an inputText then no value is sent to my value bound backing bean which
      is what I'd expect selectOneMenu to do.

      Example.

      test.jsp:
      <f:view>
      <h:form>
      <h:inputText value="#

      {testBean.dude}

      " disabled="true"/>
      <h:selectOneMenu value="#

      {testBean.dude2}

      " disabled="true">
      <f:selectItem itemLabel="One" itemValue="1"/>
      <f:selectItem itemLabel="Two" itemValue="2"/>
      <f:selectItem itemLabel="Three" itemValue="3"/>
      </h:selectOneMenu>
      <h:commandButton/>
      </h:form>
      </f:view>

      TestBean.java

      public class TestBean {
      private String dude = "Unmodified Dude String";
      private String dude2 = "2";
      public String getDude()

      { return dude; }

      public void setDude(String dude)

      { this.dude = dude; }

      public String getDude2()

      { return dude2; }

      public void setDude2(String dude2)

      { this.dude2 = dude2; }

      }

      When I submit the form then setDude is not called but setDude2 is called with
      dude2 == null.

      I actually found this bug while using javascript to disable and enable form
      items. So, it would be nice if the fix would allow for a select box disabled
      through javascript to work as well(Like inputText).

      Mike

        Activity

        Hide
        jayashri added a comment -

        Although this fixed is fixed in JSF 1.2, this helped to expose another bug in
        MenuRenderer, which was causing the "disabled" attribute specified on
        SelectOne/SelectMany tags to tbe ignored which I have fixed.
        Anyway, Mike please try with the latest nightly and let us know if you still see
        the problem.

        Show
        jayashri added a comment - Although this fixed is fixed in JSF 1.2, this helped to expose another bug in MenuRenderer, which was causing the "disabled" attribute specified on SelectOne/SelectMany tags to tbe ignored which I have fixed. Anyway, Mike please try with the latest nightly and let us know if you still see the problem.
        Hide
        Manfred Riem added a comment -

        Closing issue out

        Show
        Manfred Riem added a comment - Closing issue out

          People

          • Assignee:
            javaserverfowner
            Reporter:
            youngm
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: