|
|||||||||
| 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 name="wlw-select_key:{actionForm.itemOptions}">
<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>| Nested Class Summary | |
|---|---|
static class |
Select.RepeatingStages
This enum defines stages through the possible option values. |
static class |
Select.SelectPrefixHandler
|
| Field Summary | |
|---|---|
static String |
NULL_VALUE
Default value of the options value attribute. |
| Fields inherited from class HtmlOptionsDataSourceTag |
|---|
_optionsDataSource |
| Fields inherited from class HtmlDefaultableDataSourceTag |
|---|
_defaultValue |
| Fields inherited from class HtmlDataSourceTag |
|---|
_dataSource |
| 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 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 INameInterceptor
objects. |
Object |
getOptionsDataSource()
Gets the options datasource value (an expression). |
IDataAccessProvider |
getProviderParent()
Get the parent IDataAccessProvider of a IDataAccessProvider. |
Select.RepeatingStages |
getRepeatingStage()
Return the enum value of the currently repeating stage. |
protected AbstractHtmlState |
getState()
This method will return the state associated with the tag. |
String |
getTagName()
Return the name of the Tag. |
boolean |
isDataSourceStage()
Boolean indicating that we are processing the dataSource. |
boolean |
isDefaultStage()
Boolean indicating that we are processing the defaultValue. |
boolean |
isMatched(String value)
Does the specified value match one of those we are looking for? |
boolean |
isNullStage()
Boolean indicating that we are processing the defined null value. |
boolean |
isOptionStage()
Boolean indicating that we are processing the optionsDataSource. |
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 contained options is on. |
void |
setRepeatingOrder(String order)
This method will set the order of the options generated in the select. |
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 |
|---|
evaluateDataSource, nameHtmlControl, 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.
| Constructor Detail |
|---|
public Select()
| Method Detail |
|---|
public String getTagName()
getTagName in interface INetuiTaggetTagName in class AbstractClassicTagpublic String getDataSource()
IDataAccessProvider
getDataSource in interface IDataAccessProvidernull if no
dataSource is setprotected AbstractHtmlState getState()
getState in class HtmlBaseTagAbstractHtmlState class.protected List getNamingChain()
ArrayList which represents a chain of INameInterceptor
objects. This method by default returns null and should be overridden
by objects that support naming.
getNamingChain in class HtmlDataSourceTagArrayList that will contain INameInterceptor objects.
protected Object evaluateDefaultValue()
throws JspException
JspExceptionpublic 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 setRepeatingOrder(String order)
throws JspException
order - comma separated ordering of items when there is a repeating select.
JspExceptionpublic 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 IDataAccessProviderpublic Object getCurrentItem()
getCurrentItem in interface IDataAccessProvidernullpublic Object getCurrentMetadata()
getCurrentMetadata in interface IDataAccessProvidernull if no metadata can be
found or metadata is not supported by a IDataAccessProvider implementationpublic IDataAccessProvider getProviderParent()
null.
getProviderParent in interface IDataAccessProvidernull if this method
is not supported or the parent can not be found.public Select.RepeatingStages getRepeatingStage()
public boolean isOptionStage()
true if we are processing the optionsDataSource.public boolean isDefaultStage()
true if we are processing the defaultValue.public boolean isDataSourceStage()
true if we are processing the dataSource.public boolean isNullStage()
true if we are processing the defined null value.
public int doStartTag()
throws JspException
doStartTag in interface TagdoStartTag in class BodyTagSupportJspException - if a JSP exception has occurred
public int doAfterBody()
throws JspException
doAfterBody in interface IterationTagdoAfterBody in class BodyTagSupportJspException - if a JSP exception has occurred
public int doEndTag()
throws JspException
doEndTag in interface TagdoEndTag in class BodyTagSupportJspException - if a JSP exception has occurredprotected void localRelease()
localRelease in class HtmlOptionsDataSourceTagpublic void addFormatter(FormatTag.Formatter formatter)
addFormatter in interface IFormattableformatter - a FormatTag.Formatter added by a child FormatTag.public void formatterHasError()
formatterHasError in interface IFormattablepublic void addOptionToList(String value)
public String formatText(Object text)
throws JspException
text - the text to format.
JspExceptionpublic 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 | ||||||||