Details

    • Type: Improvement
    • Status: Reopened
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      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.

        Activity

        Hide
        medgar Malcolm Edgar added a comment -

        Changes checked into SVN, will be available in release 1.2

        regards Malcolm

        Show
        medgar Malcolm Edgar added a comment - Changes checked into SVN, will be available in release 1.2 regards Malcolm
        Hide
        medgar Malcolm Edgar added a comment -

        Will look at moving optional property into Select parent class

        Show
        medgar Malcolm Edgar added a comment - Will look at moving optional property into Select parent class
        Hide
        dfrizelle David Frizelle added a comment -

        When I read this issue, i get confused at the terminology. 'required' and 'optional' are opposites.

        Maybe rename the 'optional' property to be more specific, i.e 'addEmptyOption'.

        Also if this property is going to be added, why not change the following code:

        if (!isRequired() && isOptional()) {
        getOptionList().add(Option.EMPTY_OPTION);
        }

        to:

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

        As the required flag isn't needed to determine if the list should contain an empty option or not anymore.

        Show
        dfrizelle David Frizelle added a comment - When I read this issue, i get confused at the terminology. 'required' and 'optional' are opposites. Maybe rename the 'optional' property to be more specific, i.e 'addEmptyOption'. Also if this property is going to be added, why not change the following code: if (!isRequired() && isOptional()) { getOptionList().add(Option.EMPTY_OPTION); } to: if (addEmptyOption) { getOptionList().add(Option.EMPTY_OPTION); } As the required flag isn't needed to determine if the list should contain an empty option or not anymore.

          People

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

            Dates

            • Created:
              Updated:

              Development