Class WDropdown

    • Constructor Detail

      • WDropdown

        public WDropdown()
        Creates an empty WDropdown.
      • WDropdown

        public WDropdown​(Object[] options)
        Creates a WDropdown with the specified options.
        Parameters:
        options - the drop down options.
      • WDropdown

        public WDropdown​(List options)
        Creates a WDropdown with the specified options.
        Parameters:
        options - the drop down options.
      • WDropdown

        public WDropdown​(Object table)
        Creates a WDropdown with the options provided by the given table.
        Parameters:
        table - the table to obtain the dropdown's options from.
    • Method Detail

      • getAutocomplete

        public String getAutocomplete()
        Specified by:
        getAutocomplete in interface Autocompleteable
        Returns:
        the value of the autocomplete attribute applied to the current field.
      • addAutocompleteSection

        public void addAutocompleteSection​(String sectionName)
        Description copied from interface: Autocompleteable
        Pre-pend an autocomplete section to the value of an autocomplete attribute for the current field.
        Specified by:
        addAutocompleteSection in interface Autocompleteable
        Parameters:
        sectionName - the name of the section being the part which would replace the asterisk in the form section-*
      • setAutocomplete

        public void setAutocomplete​(DateType value)
        Description copied from interface: AutocompleteableDate
        Set the autocompletes attribute for a type of date input.
        Specified by:
        setAutocomplete in interface AutocompleteableDate
        Parameters:
        value - the type of date to auto-fill, currently only "bday" is supported.
      • setAutocomplete

        public void setAutocomplete​(Email value)
        Description copied from interface: AutocompleteableEmail
        Set the autocomplete attribute to a specific "email" value. Currently only value "email" is supported.
        Specified by:
        setAutocomplete in interface AutocompleteableEmail
        Parameters:
        value - the auto-fill hint value
      • setAutocomplete

        public void setAutocomplete​(Url value)
        Description copied from interface: AutocompleteableURL
        Set the autocomplete attribute to a specific URL auto-fill type: "url", "impp" or "photo".
        Specified by:
        setAutocomplete in interface AutocompleteableURL
        Parameters:
        value - the auto-fill hint value
      • setAutocomplete

        public void setAutocomplete​(Telephone phone,
                                    PhoneFormat phoneType)
        Description copied from interface: AutocompleteablePhone
        Set the autocomplete attribute to an appropriate value for a particular type of phone number, in either of a full or local format.
        Specified by:
        setAutocomplete in interface AutocompleteablePhone
        Parameters:
        phone - the telephone auto-fill variant, being full (including international prefix) or local (without international prefix)
        phoneType - the type of phone to which the number belongs, for example "mobile" or "fax"
      • setPhoneSegmentAutocomplete

        public void setPhoneSegmentAutocomplete​(PhoneFormat phoneType,
                                                PhonePart phoneSegment)
        Description copied from interface: AutocompleteableText
        Set the autocomplete attribute value relevant for a specified telephone number type and segment.
        Specified by:
        setPhoneSegmentAutocomplete in interface AutocompleteableText
        Parameters:
        phoneType - the type of phone number
        phoneSegment - the phone number segment
      • setAddressAutocomplete

        public void setAddressAutocomplete​(AddressType addressType,
                                           AddressPart addressPart)
        Description copied from interface: AutocompleteableText
        Set values for the autocomplete attribute applicable to an address or part thereof.
        Specified by:
        setAddressAutocomplete in interface AutocompleteableText
        Parameters:
        addressType - the type of address being auto-filled
        addressPart - the address segment for the field
      • setEditable

        @Deprecated
        public void setEditable​(boolean editable)
        Deprecated.
        editable no longer required. WSuggestions and a WTextfield should be used instead
        Sets whether the users are able to enter in an arbitrary value, rather than having to pick one from the drop-down list.
        Overrides:
        setEditable in class AbstractWSelectList
        Parameters:
        editable - true for editable, false for fixed.
      • isEditable

        @Deprecated
        public boolean isEditable()
        Deprecated.
        editable no longer required. WSuggestions and a WTextfield should be used instead
        Indicates whether users are able to enter in an arbitrary value, rather than having to pick one from the drop-down list.
        Overrides:
        isEditable in class AbstractWSelectList
        Returns:
        true if the user can enter arbitrary values, false if not.
      • setType

        @Deprecated
        public void setType​(WDropdown.DropdownType type)
        Deprecated.
        No longer required as COMBO will be dropped. WSuggestions and a WTextfield should be used instead
        Sets the type of this drop down. If un-set, reverts to the un-editable/native type.
        Parameters:
        type - one of native or combo.
      • getType

        @Deprecated
        public WDropdown.DropdownType getType()
        Deprecated.
        No longer required as COMBO will be dropped. WSuggestions and a WTextfield should be used instead
        Indicates the type of this drop down.
        Returns:
        the drop down type, one of native or combo.
      • setOptionWidth

        @Deprecated
        public void setOptionWidth​(int optionWidth)
        Deprecated.
        as DropdownType.COMBO is deprecated.
        Set the width of the selectable options in a COMBO when rendered to screen. Has no effect with a native drop down.
        Parameters:
        optionWidth - the option width.
      • getOptionWidth

        public int getOptionWidth()
        Get the width of the selectable options when rendered to screen. Has no effect with a native drop down.
        Returns:
        the option width.
      • getComponentModel

        protected WDropdown.DropdownModel getComponentModel()
        Returns the effective component model for this component. Subclass may override this method to narrow the return type to their specific model type.
        Overrides:
        getComponentModel in class AbstractWSelectList
        Returns:
        the effective component model
      • getOrCreateComponentModel

        protected WDropdown.DropdownModel getOrCreateComponentModel()
        Retrieves the model for this component so that it can be modified. If this method is called during request processing, and a session specific model does not yet exist, then a new model is created. Subclasses may override this method to narrow the return type to their specific model type.
        Overrides:
        getOrCreateComponentModel in class AbstractWSelectList
        Returns:
        the model for this component