Click
  1. Click
  2. CLK-34

Setting multipleValues on Select

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      If you have a multiple Select, it is difficult to preset the multipleValues to a known state. For example, if I have a list of Customers and I want to show that a couple of them are selected, I cannot setMultipleValues on Select. My only way around this at present is to subclass Select and handle it myself.

      It would be better that the Select class itself handled the setting of multipleValues.

        Activity

        Hide
        Malcolm Edgar added a comment -

        What sort of API do you think would be appropriate:

        public void select(String value);

        public void select(Option option);

        public void selectMultiple(String[] values);

        public void selectMultiple(List options);

        regards Malcolm Edgar

        Show
        Malcolm Edgar added a comment - What sort of API do you think would be appropriate: public void select(String value); public void select(Option option); public void selectMultiple(String[] values); public void selectMultiple(List options); regards Malcolm Edgar
        Hide
        Geoff Hopson added a comment -

        Right now my subclass of Select has a single method -

        public void setMultipleValues(ArrayList values)

        { this.multipleValues = values; }

        That works fine, and the Option code iterates over the multipleValues and does the right thing with the value of the Option. So, for example, if one of the Option values is 789 and my multipleValues list contains 789, the Option appears selected in the Select.

        Best wishes
        Geoff

        Show
        Geoff Hopson added a comment - Right now my subclass of Select has a single method - public void setMultipleValues(ArrayList values) { this.multipleValues = values; } That works fine, and the Option code iterates over the multipleValues and does the right thing with the value of the Option. So, for example, if one of the Option values is 789 and my multipleValues list contains 789, the Option appears selected in the Select. Best wishes Geoff
        Hide
        Malcolm Edgar added a comment -

        Added new method as suggested, much eaiser.

        regards Malcolm

        Show
        Malcolm Edgar added a comment - Added new method as suggested, much eaiser. regards Malcolm

          People

          • Assignee:
            Malcolm Edgar
            Reporter:
            Geoff Hopson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development