Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2 Sprint 8
    • Fix Version/s: 2.0
    • Component/s: Uncategorized
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      451
    • Status Whiteboard:
      Hide

      EGEasy5

      Show
      EGEasy5

      Description

      A very common use case for a dropdown (which I'll use a synonym for h:select*)
      is to display a "Please Select..." label. Trinidad implements this by adding new
      tr:select* (which is the neater approach) and Seam hacks this into s:selectItems
      (which allows you to use the standard components). For JSF2 I would propose we
      add it to h:select*.

      Add two attributes to all dropdown components, both of which can take EL:

      • noSelectionLabel - specifies the (optional) label to place at the top of list
      • hideNoSelectionLabel - if true, the noSelectionLabel will be hidden when a
        value is selected

      If a noSelectionLabel is selected, and the value is required (in JSF 1.2 through
      the use of required="true", in JSF 2 additionally through the use of a
      NotNullValidator), then the component should not pass validation. Otherwise, if
      a noSelectionLabel is selected, and the value is not required, null should be
      set on the model.

      The hideNoSelection attribute is necessary because of the issue with EL
      returning an empty string for null (an empty string is a valid String to want as
      your noSelectionLabel!) so you can't write:

      noSelectionLabel="#

      {x eq y ? 'Please Select' : null}

      "

      and take null as the instruction to hide the label.

      If we can resolve the EL issue in this instance, I suggest altering the
      attributes to:

      • noSelectionLabel - specifies the (optional) label to place at the top of list.
        If the value is 'null' then the label should be hidden.
      1. changebundle.txt
        36 kB
        Ed Burns
      2. changebundle.txt
        26 kB
        Ed Burns

        Activity

        Hide
        Ed Burns added a comment -

        For hideNoSelection, in the case of selectMany, we hide the noSelectionOption if and only if the set of
        selected values includes anything other than the noSelectionOption.

        Show
        Ed Burns added a comment - For hideNoSelection, in the case of selectMany, we hide the noSelectionOption if and only if the set of selected values includes anything other than the noSelectionOption.
        Hide
        Ed Burns added a comment -

        I've made the following change to the standard-html-renderkit docs for the "rendering the option
        elements" section, which is used to specify the behavior for all the select* elements.

        If the current child is a SelectItem whose noSelctionProperty is true, and the UISelectOne or UISelectMany
        parent of this option has one or more selected values that are not the "no selection" SelectItem, and the
        component has a "hideNoSelectionLabel" attribute whose value is true, then the current option, which is
        the "no selection" option, must not be rendered.

        I have analyzed the impl requirements for this issue and have found that it's possible to implement, but
        not the best thing for me to work on right now.

        Show
        Ed Burns added a comment - I've made the following change to the standard-html-renderkit docs for the "rendering the option elements" section, which is used to specify the behavior for all the select* elements. If the current child is a SelectItem whose noSelctionProperty is true, and the UISelectOne or UISelectMany parent of this option has one or more selected values that are not the "no selection" SelectItem, and the component has a "hideNoSelectionLabel" attribute whose value is true, then the current option, which is the "no selection" option, must not be rendered. I have analyzed the impl requirements for this issue and have found that it's possible to implement, but not the best thing for me to work on right now.
        Hide
        Ed Burns added a comment -

        Fix checked in.

        Show
        Ed Burns added a comment - Fix checked in.
        Hide
        Ed Burns added a comment -

        Prepare to delete api subcomponent

        Show
        Ed Burns added a comment - Prepare to delete api subcomponent
        Hide
        Manfred Riem added a comment -

        Closing resolved issue out

        Show
        Manfred Riem added a comment - Closing resolved issue out

          People

          • Assignee:
            Ed Burns
            Reporter:
            pmuir
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: