Class Select

  • All Implemented Interfaces:
    Serializable, DynamicAttributes, IterationTag, JspTag, Tag, DynamicActionAttributes

    public class Select
    extends StylableTag
    This tag is used to display a selection list of items. The list can be linked to a selection popup and has options for the current item and recently used items.

    Example:

       <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
       <base:select 
            id="protocol"
            required="false"
            current="<%=currentProtocol%>"
            denied="false"
            recent="<%=recentProtocols%>"
       />
     

    Syntax:

       <base:select
          id=...
          clazz=...
          style=...
          buttonclass=...
          buttonstyle=...
          buttontitle=...
          buttonicon=...
          required=true|false
          current=...
          denied=true|false
          recent=...
          selectrecent=true|false
          defaultitem=...
          selectdefault=true|false
          newitem=true|false
          visible=true|false
          disabled=true|false
          tabindex=...
       >
    
    Tag attributes
    Attribute Default value Required Description
    id - yes The ID of the selection list. The value of this attribute goes directly into the standard name attribute of a <select> tag.
    clazz no The value if this attribute goes directly into the standard HTML class attribute. This allows you to apply different styles to different selection lists.
    style - no The value if this attribute goes directly into the standard HTML style attribute. This allows you to apply different styles to different selection lists.
    buttonclass buttonclass no The value if this attribute goes directly into the standard HTML class attribute for the "Select" button part. This allows you to apply different styles to the button. If the button is disabled "_disabled" is appended to the class name.
    buttonstyle - no The value if this attribute goes directly into the standard HTML style attribute for the "Select" button part. This allows you to apply different styles to the button.
    buttontitle Select no The text on the "Select" button.
    buttonicon select.png no The icon to use on the "Select" button.
    required false no If a value must be selected or not. If FALSE is specified the option - none - will be included.
    current null yes The current item that is selected. It should be a BasicItem.
    denied false no If null is passed as the current item, this parameter should be TRUE if the reason is that the logged in user is denied read access, FALSE otherwise.
    recent no A list of recently used items. The should be of the same type as the current item.
    selectrecent true no If no current has been specified and it is a new item then, if this parameter is TRUE the first recently used value is selected. If this parameter is FALSE, no item is selected.
    defaultitem no Default value set e.g. for a project.
    selectdefault true no If no current or recent has been specified and it is a new item then, if this parameter is TRUE the default value is selected. If this parameter is FALSE, no item is selected.
    newitem false no If the parent item is a new item or an already saved item. This affects the ID of the current item that is used in the list. For existing values the ID is negative, which means that the link doesn't have to change unless another item is selected.
    visible true no If the selection list should be visible or not.
    disabled false no If the selection list should be enabled or not.
    tabindex 0 no Tab index value to control the focus order. Use -1 to disable tabbing to the control.
    Version:
    2.0
    Author:
    Nicklas
    See Also:
    Serialized Form
    • Field Detail

      • buttonclass

        private String buttonclass
      • buttonstyle

        private String buttonstyle
      • buttontitle

        private String buttontitle
      • buttonicon

        private String buttonicon
      • required

        private boolean required
        If a value is required or not.
      • current

        private transient BasicItem current
        The currently selected item.
      • denied

        private boolean denied
        If the logged in user was denied access to the current item.
      • recent

        private transient List<? extends BasicItem> recent
        List of recently used items.
      • selectRecent

        private boolean selectRecent
        If we can select the most recently used item for new items with nu current item.
      • defaultItems

        private transient List<? extends BasicItem> defaultItems
        The project default values.
      • selectdefault

        private boolean selectdefault
        If the default item should be selected for new items with no current or recently used items.
      • newItem

        private boolean newItem
        If the link is from a new item or an old item.
      • visible

        private boolean visible
        If the select list should be visible or not.
      • disabled

        private boolean disabled
        If the selection list should be enabled or not.
      • unselectedText

        private String unselectedText
        Text to display that for the "unselected" option
      • tabIndex

        private int tabIndex
      • tryGetDirectoryPath

        private boolean tryGetDirectoryPath
    • Constructor Detail

      • Select

        public Select()
    • Method Detail

      • setButtonclass

        public void setButtonclass​(String clazz)
        Since:
        3.0
      • getButtonclass

        public String getButtonclass()
        Since:
        3.0
      • setButtonstyle

        public void setButtonstyle​(String style)
        Since:
        3.0
      • getButtonstyle

        public String getButtonstyle()
        Since:
        3.0
      • setButtontitle

        public void setButtontitle​(String title)
        Since:
        3.0
      • getButtontitle

        public String getButtontitle()
        Since:
        3.0
      • setButtonicon

        public void setButtonicon​(String icon)
        Since:
        3.0
      • getButtonicon

        public String getButtonicon()
        Since:
        3.0
      • setRequired

        public void setRequired​(boolean required)
      • isRequired

        public boolean isRequired()
      • setCurrent

        public void setCurrent​(BasicItem current)
      • setDenied

        public void setDenied​(boolean denied)
      • isDenied

        public boolean isDenied()
      • setRecent

        public void setRecent​(List<? extends BasicItem> recent)
      • setSelectrecent

        public void setSelectrecent​(boolean selectRecent)
      • getSelectrecent

        public boolean getSelectrecent()
      • setDefaultitem

        public void setDefaultitem​(BasicItem defaultitem)
      • setDefaultitems

        public void setDefaultitems​(List<? extends BasicItem> defaultItems)
      • setSelectdefault

        public void setSelectdefault​(boolean selectdefault)
      • getSelectdefault

        public boolean getSelectdefault()
      • setNewitem

        public void setNewitem​(boolean newItem)
      • isNewitem

        public boolean isNewitem()
      • setVisible

        public void setVisible​(boolean visible)
      • isVisible

        public boolean isVisible()
      • setDisabled

        public void setDisabled​(boolean disabled)
      • isDisabled

        public boolean isDisabled()
      • setUnselectedtext

        public void setUnselectedtext​(String unselectedText)
      • getUnselectedtext

        public String getUnselectedtext()
      • setTabindex

        public void setTabindex​(int tabIndex)
        Since:
        3.2
      • getTabindex

        public int getTabindex()