Package net.sf.basedb.clients.web.taglib
Class Select
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- net.sf.basedb.clients.web.taglib.StylableTag
-
- net.sf.basedb.clients.web.taglib.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 Summary
Fields Modifier and Type Field Description private String
buttonclass
private String
buttonicon
private String
buttonstyle
private String
buttontitle
private BasicItem
current
The currently selected item.private 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 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 String
unselectedText
Text to display that for the "unselected" optionprivate boolean
visible
If the select list should be visible or not.-
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
-
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
-
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
-
-
Constructor Summary
Constructors Constructor Description Select()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
doStartTag()
String
getButtonclass()
String
getButtonicon()
String
getButtonstyle()
String
getButtontitle()
BasicItem
getCurrent()
private String
getName(BasicItem item)
List<? extends BasicItem>
getRecent()
boolean
getSelectdefault()
boolean
getSelectrecent()
int
getTabindex()
String
getUnselectedtext()
boolean
isDenied()
boolean
isDisabled()
boolean
isNewitem()
boolean
isRequired()
boolean
isVisible()
void
setButtonclass(String clazz)
void
setButtonicon(String icon)
void
setButtonstyle(String style)
void
setButtontitle(String title)
void
setCurrent(BasicItem current)
void
setDefaultitem(BasicItem defaultitem)
void
setDefaultitems(List<? extends BasicItem> defaultItems)
void
setDenied(boolean denied)
void
setDisabled(boolean disabled)
void
setNewitem(boolean newItem)
void
setRecent(List<? extends BasicItem> recent)
void
setRequired(boolean required)
void
setSelectdefault(boolean selectdefault)
void
setSelectrecent(boolean selectRecent)
void
setTabindex(int tabIndex)
void
setUnselectedtext(String unselectedText)
void
setVisible(boolean visible)
-
Methods inherited from class net.sf.basedb.clients.web.taglib.StylableTag
addDynamicAttributes, addIdAndStyles, getClazz, getDynamicActionAttributes, getDynamicAttribute, getFullClass, getIdPrefix, getStyle, getSubclass, initDefaultAttributes, setClazz, setDynamicAttribute, setMoreDynamicAttributes, setPageContext, setStyle, setSubclass
-
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setParent, setValue
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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.
-
selectRecent
private boolean selectRecent
If we can select the most recently used item for new items with nu current item.
-
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
-
-
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)
-
getCurrent
public BasicItem getCurrent()
-
setDenied
public void setDenied(boolean denied)
-
isDenied
public boolean isDenied()
-
setSelectrecent
public void setSelectrecent(boolean selectRecent)
-
getSelectrecent
public boolean getSelectrecent()
-
setDefaultitem
public void setDefaultitem(BasicItem defaultitem)
-
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()
-
doStartTag
public int doStartTag() throws JspException
- Specified by:
doStartTag
in interfaceTag
- Overrides:
doStartTag
in classTagSupport
- Throws:
JspException
-
-