Uploaded image for project: 'Click'
  1. Click
  2. CLK-156

QuerySelect as optional

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • all

    Description

      Currently the QuerySelect is rendered into two different ways on a form:

      with required set to true an Option.EMPTY_OPTION is add on the option's list
      with required set to false the first option is rendered

      I have a form with a lot of QuerySelect and some are mandatory and some are optional with the same options, so I modified the QuerySelect adding a new optional flag with his setter and getter methods:

      protected boolean optional;

      a new constructor

      public QuerySelect(String name, boolean required, boolean optional)

      { super(name, required); this.setOptional(optional); }

      and on the loadOptionList() method

      if (!isRequired() && isOptional())

      { getOptionList().add(Option.EMPTY_OPTION); }

      Probably the right place where to put this is on the Field class, but this modification cover my needs.

      Attachments

        Activity

          People

            medgar Malcolm Edgar
            lorselli Lorenzo Orselli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: