public class Select extends StylableTag
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=... >
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. |
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
buttonclass |
private java.lang.String |
buttonicon |
private java.lang.String |
buttonstyle |
private java.lang.String |
buttontitle |
private BasicItem |
current
The currently selected item.
|
private java.util.List<? extends BasicItem> |
defaultItems
The project default values.
|
private boolean |
denied
If the logged in user was denied access to the current item.
|
private boolean |
disabled
If the selection list should be enabled or not.
|
private boolean |
newItem
If the link is from a new item or an old item.
|
private java.util.List<? extends BasicItem> |
recent
List of recently used items.
|
private boolean |
required
If a value is required or not.
|
private boolean |
selectdefault
If the default item should be selected for new items with
no current or recently used items.
|
private boolean |
selectRecent
If we can select the most recently used item for new items
with nu current item.
|
private static long |
serialVersionUID |
private int |
tabIndex |
private boolean |
tryGetDirectoryPath |
private java.lang.String |
unselectedText
Text to display that for the "unselected" option
|
private boolean |
visible
If the select list should be visible or not.
|
id, pageContext
EVAL_BODY_AGAIN
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor and Description |
---|
Select() |
Modifier and Type | Method and Description |
---|---|
int |
doStartTag() |
java.lang.String |
getButtonclass() |
java.lang.String |
getButtonicon() |
java.lang.String |
getButtonstyle() |
java.lang.String |
getButtontitle() |
BasicItem |
getCurrent() |
private java.lang.String |
getName(BasicItem item) |
java.util.List<? extends BasicItem> |
getRecent() |
boolean |
getSelectdefault() |
boolean |
getSelectrecent() |
int |
getTabindex() |
java.lang.String |
getUnselectedtext() |
boolean |
isDenied() |
boolean |
isDisabled() |
boolean |
isNewitem() |
boolean |
isRequired() |
boolean |
isVisible() |
void |
setButtonclass(java.lang.String clazz) |
void |
setButtonicon(java.lang.String icon) |
void |
setButtonstyle(java.lang.String style) |
void |
setButtontitle(java.lang.String title) |
void |
setCurrent(BasicItem current) |
void |
setDefaultitem(BasicItem defaultitem) |
void |
setDefaultitems(java.util.List<? extends BasicItem> defaultItems) |
void |
setDenied(boolean denied) |
void |
setDisabled(boolean disabled) |
void |
setNewitem(boolean newItem) |
void |
setRecent(java.util.List<? extends BasicItem> recent) |
void |
setRequired(boolean required) |
void |
setSelectdefault(boolean selectdefault) |
void |
setSelectrecent(boolean selectRecent) |
void |
setTabindex(int tabIndex) |
void |
setUnselectedtext(java.lang.String unselectedText) |
void |
setVisible(boolean visible) |
addDynamicAttributes, addIdAndStyles, getClazz, getDynamicActionAttributes, getDynamicAttribute, getFullClass, getIdPrefix, getStyle, getSubclass, initDefaultAttributes, setClazz, setDynamicAttribute, setMoreDynamicAttributes, setPageContext, setStyle, setSubclass
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setParent, setValue
private static final long serialVersionUID
private java.lang.String buttonclass
private java.lang.String buttonstyle
private java.lang.String buttontitle
private java.lang.String buttonicon
private boolean required
private transient BasicItem current
private boolean denied
private transient java.util.List<? extends BasicItem> recent
private boolean selectRecent
private transient java.util.List<? extends BasicItem> defaultItems
private boolean selectdefault
private boolean newItem
private boolean visible
private boolean disabled
private java.lang.String unselectedText
private int tabIndex
private boolean tryGetDirectoryPath
public void setButtonclass(java.lang.String clazz)
public java.lang.String getButtonclass()
public void setButtonstyle(java.lang.String style)
public java.lang.String getButtonstyle()
public void setButtontitle(java.lang.String title)
public java.lang.String getButtontitle()
public void setButtonicon(java.lang.String icon)
public java.lang.String getButtonicon()
public void setRequired(boolean required)
public boolean isRequired()
public void setCurrent(BasicItem current)
public BasicItem getCurrent()
public void setDenied(boolean denied)
public boolean isDenied()
public void setRecent(java.util.List<? extends BasicItem> recent)
public java.util.List<? extends BasicItem> getRecent()
public void setSelectrecent(boolean selectRecent)
public boolean getSelectrecent()
public void setDefaultitem(BasicItem defaultitem)
public void setDefaultitems(java.util.List<? extends BasicItem> defaultItems)
public void setSelectdefault(boolean selectdefault)
public boolean getSelectdefault()
public void setNewitem(boolean newItem)
public boolean isNewitem()
public void setVisible(boolean visible)
public boolean isVisible()
public void setDisabled(boolean disabled)
public boolean isDisabled()
public void setUnselectedtext(java.lang.String unselectedText)
public java.lang.String getUnselectedtext()
public void setTabindex(int tabIndex)
public int getTabindex()
public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class TagSupport
JspException
private java.lang.String getName(BasicItem item)