Class ComboTag

All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag

public class ComboTag extends FormElementTag
A JSP tag to support generating HTML combo/list boxes.
Since:
1.0
Version:
11.0
Author:
Luke
See Also:
  • Constructor Details

    • ComboTag

      public ComboTag()
      Create a new combo/listbox tag.
  • Method Details

    • setPageContext

      public void setPageContext(PageContext ctxt)
      Loads airport formatting preferences from the logged in user.
      Specified by:
      setPageContext in interface Tag
      Overrides:
      setPageContext in class ElementTag
    • doEndTag

      public int doEndTag() throws JspException
      Generates the combo/listbox by writing a >SELECT< tag, rendering all choices as >OPTION< elements, then writing a >/SELECT< tag.
      Specified by:
      doEndTag in interface Tag
      Overrides:
      doEndTag in class TagSupport
      Throws:
      JspException - if an I/O error occurs
    • setValues

      public void setValues(Collection<?> values)
      Sets the value(s) of this combo/listbox.
      Parameters:
      values - a Collection of selected values
    • setSize

      public void setSize(int size)
      Sets the size of this combo/list box. This does nothing if a negative, zero or non-numeric value is passed.
      Parameters:
      size - the size of the combo/list box, in entries
      See Also:
    • setOnChange

      public void setOnChange(String js)
      Sets the Javascript to execute when this element's value is changed.
      Parameters:
      js - the JavaScript code to execute
    • setOnRightClick

      public void setOnRightClick(String js)
      Sets the Javascript to execute when the element is right-clicked.
      Parameters:
      js - the JavaScript code to execute
    • setFirstEntry

      public void setFirstEntry(Object entry)
      Allows an entry to be inserted before the rest of the options.
      Parameters:
      entry - the first entry to insert
    • setMultiple

      public void setMultiple(boolean allowMulti)
      Marks this as a listbox (allowing multiple entries).
      Parameters:
      allowMulti - TRUE if enabled, otherwise FALSE
    • setOptions

      public void setOptions(Collection<?> choices)
      Sets the choices for this combo/listbox.
      Parameters:
      choices - a List of choices
    • release

      public void release()
      Specified by:
      release in interface Tag
      Overrides:
      release in class ElementTag