|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTagSupport
BodyTagSupport
AbstractClassicTag
HtmlBaseTag
HtmlFocusBaseTag
HtmlDataSourceTag
HtmlDefaultableDataSourceTag
HtmlOptionsDataSourceTag
Select
public class Select
Renders a select containing a set of SelectOptions. Select binds to an Iterator of Strings. If Select uses any Format tags, it must have those tags come before any nested SelectOption tags.
optionsDataSource
attribute to reference a
dynamically generated dropdown list.
<netui:select dataSource="{actionForm.selectedOption}" optionsDataSource="{actionForm.itemOptions}" />
Assume that the optionsDataSource
attribute refers to
a java.util.Map
object.
The Map object will be rendered as a series
of <option> tags. HTML that is similar to the following will be
rendered in the browser:
<select> <option value="633">Aurora Bridge</option> <option value="631">FA-18 fighter jet</option> <option value="635">Space Needle</option> <option value="642">Thin Mints</option> ... </select>
Field Summary | |
---|---|
static String |
NULL_VALUE
Default value of the options value attribute. |
static String |
REPEATING_DATA
Constant value of the repeatingType attribute for options handling the optionsDataSource,
defaultValue and dataSource . |
static String |
REPEATING_DATASOURCE
Constant value of the repeatingType attribute for options handling the dataSource . |
static String |
REPEATING_DEFAULT
Constant value of the repeatingType attribute for options handling the defaultValue . |
static String |
REPEATING_NULL
Constant value of the repeatingType attribute for options handling the null option. |
static String |
REPEATING_OPTION
Constant value of the repeatingType attribute for options handling the optionsDataSource . |
static int |
STAGE_DATASOURCE
int value returned by getRepeatingStage when the dataSource
is being processed. |
static int |
STAGE_DEFAULT
int value returned by getRepeatingStage when the defaultValue
is being processed. |
static int |
STAGE_NULL
int value returned by getRepeatingStage when the null option
is being processed. |
static int |
STAGE_OPTION
int value returned by getRepeatingStage when the optionsDataSource
is being processed. |
Fields inherited from class HtmlOptionsDataSourceTag |
---|
_optionsDataSource |
Fields inherited from class HtmlDefaultableDataSourceTag |
---|
_defaultValue |
Fields inherited from class HtmlDataSourceTag |
---|
_dataSource |
Fields inherited from class HtmlBaseTag |
---|
JAVASCRIPT_STATUS |
Fields inherited from class AbstractClassicTag |
---|
DefaultNamingChain, EMPTY_STRING, NETUI_UNIQUE_CNT |
Fields inherited from class BodyTagSupport |
---|
bodyContent |
Fields inherited from class TagSupport |
---|
id, pageContext |
Fields inherited from interface HtmlConstants |
---|
ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH |
Fields inherited from interface BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
Select()
|
Method Summary | |
---|---|
void |
addFormatter(FormatTag.Formatter formatter)
Adds a FormatTag.Formatter to the Select's set of formatters |
void |
addOptionToList(String value)
|
int |
doAfterBody()
Save any body content of this tag, which will generally be the option(s) representing the values displayed to the user. |
int |
doEndTag()
Render the end of this select. |
int |
doStartTag()
Render the beginning of this select. |
protected Object |
evaluateDefaultValue()
Evaluate the defaultValues |
protected Object |
evaluateOptionsDataSource()
This method will return the object representing the optionsDataSource . |
void |
formatterHasError()
Indicate that a formatter has reported an error so the formatter should output it's body text. |
String |
formatText(Object text)
Apply the Select's set of formatters to the given text |
int |
getCurrentIndex()
Get the current index in this iteration. |
Object |
getCurrentItem()
Get the current data item in this IDataAccessProvider. |
Object |
getCurrentMetadata()
Get a metadata object for the current item. |
String |
getDataSource()
Get the expression that references the data item to which the IDataAccessProvider is bound. |
protected List |
getNamingChain()
Return an ArrayList which represents a chain of NameInterceptor
objects. |
Object |
getOptionsDataSource()
Gets the options datasource value (an expression). |
IDataAccessProvider |
getProviderParent()
Get the parent IDataAccessProvider of a IDataAccessProvider. |
int |
getRepeatingStage()
This method will return the current stage being process when the select is acting as a repeater. |
protected AbstractHtmlState |
getState()
This method will return the state associated with the tag. |
String |
getTagName()
Return the name of the Tag. |
boolean |
isBindingOnClient()
This method indicates that the expression of the repeater is bound into a client based context. |
boolean |
isMatched(String value)
Does the specified value match one of those we are looking for? |
boolean |
isRepeater()
Gets whether a repeating contained options is on. |
protected void |
localRelease()
Release any acquired resources. |
void |
setAccessKey(char accessKey)
Sets the accessKey attribute value. |
void |
setMultiple(boolean multiple)
Set whether multiple selections are allowed. |
void |
setNullable(boolean nullable)
Set whether a null option is desired. |
void |
setNullableOptionText(String nullableOptionText)
Set the text of the nullable option. |
void |
setRepeater(boolean repeater)
Set whether repeating of contains options is on. |
void |
setSize(int size)
Sets how many options are displayed. |
void |
setTabindex(int tabindex)
Sets the tabIndex of the rendered html tag. |
Methods inherited from class HtmlOptionsDataSourceTag |
---|
setOptionsDataSource |
Methods inherited from class HtmlDefaultableDataSourceTag |
---|
setDefaultValue |
Methods inherited from class HtmlDataSourceTag |
---|
doNaming, evaluateDataSource, setDataSource |
Methods inherited from class HtmlFocusBaseTag |
---|
isDisabled, setDisabled, setOnBlur, setOnChange, setOnFocus, setOnSelect |
Methods inherited from class BodyTagSupport |
---|
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
Methods inherited from class TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface Tag |
---|
getParent, setPageContext, setParent |
Field Detail |
---|
public static final String NULL_VALUE
value
attribute.
public static final String REPEATING_OPTION
repeatingType
attribute for options handling the optionsDataSource
.
public static final String REPEATING_DEFAULT
repeatingType
attribute for options handling the defaultValue
.
public static final String REPEATING_DATASOURCE
repeatingType
attribute for options handling the dataSource
.
public static final String REPEATING_DATA
repeatingType
attribute for options handling the optionsDataSource,
defaultValue and dataSource
.
public static final String REPEATING_NULL
repeatingType
attribute for options handling the null
option.
public static final int STAGE_OPTION
int
value returned by getRepeatingStage
when the optionsDataSource
is being processed.
public static final int STAGE_DATASOURCE
int
value returned by getRepeatingStage
when the dataSource
is being processed.
public static final int STAGE_DEFAULT
int
value returned by getRepeatingStage
when the defaultValue
is being processed.
public static final int STAGE_NULL
int
value returned by getRepeatingStage
when the null
option
is being processed.
Constructor Detail |
---|
public Select()
Method Detail |
---|
public String getTagName()
getTagName
in interface INetuiTag
getTagName
in class AbstractClassicTag
public String getDataSource()
IDataAccessProvider
getDataSource
in interface IDataAccessProvider
null
if no
dataSource is setprotected AbstractHtmlState getState()
getState
in class HtmlBaseTag
AbstractHtmlState
class.protected List getNamingChain()
ArrayList
which represents a chain of NameInterceptor
objects. This method by default returns null
and should be overridden
by objects that support naming.
getNamingChain
in class HtmlDataSourceTag
ArrayList
that will contain NameInterceptor
objects.protected Object evaluateDefaultValue() throws JspException
JspException
public void setMultiple(boolean multiple)
multiple
- - the multiple value ("true" or "false")public void setRepeater(boolean repeater)
repeater
- - the repeater value ("true" or "false")public boolean isRepeater()
public void setNullable(boolean nullable)
nullable
- - the nullable valuepublic Object getOptionsDataSource()
public void setNullableOptionText(String nullableOptionText)
nullable option is true, this is
the text of that option. The default is "";
protected Object evaluateOptionsDataSource() throws JspException
optionsDataSource
. This
is overridden from the base class, because there are only two types which will be
retunred from the method. The optionsDataSource
will either be a instance of a Map
or and instanceof a Iterator
.
JspException
- on an errorpublic void setSize(int size)
size
- - the size (a number)public boolean isMatched(String value)
value
- Value to be comparedpublic int getCurrentIndex()
getCurrentIndex
in interface IDataAccessProvider
public Object getCurrentItem()
getCurrentItem
in interface IDataAccessProvider
null
public Object getCurrentMetadata()
getCurrentMetadata
in interface IDataAccessProvider
null
if no metadata can be
found or metadata is not supported by a IDataAccessProvider implementationpublic IDataAccessProvider getProviderParent()
null
.
getProviderParent
in interface IDataAccessProvider
null
if this method
is not supported or the parent can not be found.public boolean isBindingOnClient()
true
if the expression of this is bound on the client.public int getRepeatingStage()
STAGE_OPTION, STAGE_DATASOURCE, STAGE_DEFAULT,
STAGE_NULL
public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class BodyTagSupport
JspException
- if a JSP exception has occurredpublic int doAfterBody() throws JspException
doAfterBody
in interface IterationTag
doAfterBody
in class BodyTagSupport
JspException
- if a JSP exception has occurredpublic int doEndTag() throws JspException
doEndTag
in interface Tag
doEndTag
in class BodyTagSupport
JspException
- if a JSP exception has occurredprotected void localRelease()
localRelease
in class HtmlOptionsDataSourceTag
public void addFormatter(FormatTag.Formatter formatter)
addFormatter
in interface Formattable
formatter
- - a FormatTag.Formatter added by a child FormatTag.public void formatterHasError()
formatterHasError
in interface Formattable
public void addOptionToList(String value)
public String formatText(Object text) throws JspException
text
- - the text to format.
JspException
public void setAccessKey(char accessKey)
A, C, E, F, G,
H, V, left arrow, and right arrow
.
accessKey
- - the accessKey value.public void setTabindex(int tabindex)
tabindex
- - the tab index.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |