|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
com.taggercat.tags.ListOptionListTag
public class ListOptionListTag
This tag creates an option list that is filled from a List or Map object rather than from a code table, or other data source. The List or Map object can be in any accessible scope.
List objects are used where the stored value is the same as the display value. Map objects are used when the stored value is a key to the display value ( a coded value list ).
Alternatively, you can specify the list values setting the listOptions
attribute to a comma-separated list. If the listOptions attribute is
set in conjunction with the listVar attribute, and the listVar instance
does not exist, then the listVar named scope variable will be created from the
listOptions attribute list.
Example:
<select name="Part Selection" style="WIDTH:120px" > <tc:listOptionList dsn='partType' displayField='type' listVar='application.ExtraParts' /> </select>Example with QBF field.
<select name='employees.qbf.EmpType' style='WIDTH:120px'> <tc:listOptionList listVar='session.ColorOptions' emptyItem='true' selected='employees.qbf.EmpType'/> </select>Example with an explicit list.
<tc:listmenu dsn='account' field='accountType' style='WIDTH:120px' >
<tc:listOptionList listVar='applicationScope.accountTypes' listOptions='savings,checking,investment' />
</tc:listmenu >
Example with an explicit map list.
<tc:listmenu dsn='account' field='accountTypeId' style='WIDTH:120px' >
<tc:listOptionList listVar='applicationScope.accountTypeCodes' mapOptions='1:savings,2:checking,3:investment' />
</tc:listmenu >
![]() |
![]() |
| Field Summary |
|---|
| 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 | |
|---|---|
ListOptionListTag()
|
|
| Method Summary | |
|---|---|
int |
doEndTag()
Resets the tags internal state. |
int |
doStartTag()
Creates and the option list tags and sends them to the page. |
java.lang.String |
getDsn()
Gets the sources data source name. |
java.lang.String |
getSelected()
Gets the selected item. |
java.lang.String |
getSelectedStyleclass()
Gets the CSS style class to be used to selected items in the option list. |
java.lang.String |
getStyleclass()
Gets the CSS style class to be used to items in the option list. |
void |
setDsn(java.lang.String dsn)
Set the name of the data source this field to test as a boolean ( optional ). |
void |
setEmptyItem(boolean emptyItem)
Set to true to add an empty item to the option list. |
void |
setField(java.lang.String field)
Sets the field name attribute ( optional ). |
void |
setListOptions(java.lang.String listOptions)
Sets the listOptions attribute. |
void |
setListVar(java.lang.String listVar)
Sets the listVar attribute . |
void |
setMapOptions(java.lang.String mapOptions)
Sets the mapOptions attribute. |
void |
setMissingItemStyleclass(java.lang.String missingItemStyleclass)
Sets the CSS style class to be used to display a missing, and selected items in the option list. |
void |
setSelected(java.lang.String selected)
Sets the selected attribute. |
void |
setSelectedStyleclass(java.lang.String selectedStyleclass)
Sets the CSS style class to be used to selected items in the option list. |
void |
setStyleclass(java.lang.String styleclass)
Sets the CSS style class to be used to items in the option list. |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
|---|
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ListOptionListTag()
| Method Detail |
|---|
public int doEndTag()
throws javax.servlet.jsp.JspException
doEndTag in interface javax.servlet.jsp.tagext.TagdoEndTag in class javax.servlet.jsp.tagext.TagSupportjavax.servlet.jsp.JspException
public int doStartTag()
throws javax.servlet.jsp.JspException
doStartTag in interface javax.servlet.jsp.tagext.TagdoStartTag in class javax.servlet.jsp.tagext.TagSupportjavax.servlet.jsp.JspException
public java.lang.String getDsn()
public java.lang.String getSelected()
public java.lang.String getSelectedStyleclass()
public java.lang.String getStyleclass()
public void setEmptyItem(boolean emptyItem)
emptyItem - The new codeField valuepublic void setDsn(java.lang.String dsn)
dsn - the new dsn fieldValuepublic void setField(java.lang.String field)
field - the new field fieldValuepublic void setListVar(java.lang.String listVar)
listVar - the new listVar fieldValuepublic void setSelected(java.lang.String selected)
selected - The new selected valuepublic void setListOptions(java.lang.String listOptions)
listOptions - The list of optionspublic void setMapOptions(java.lang.String mapOptions)
mapOptions - The map name-value pairspublic void setSelectedStyleclass(java.lang.String selectedStyleclass)
selectedStyleclass - the CSS style class to be used to selected items in the option list.public void setStyleclass(java.lang.String styleclass)
styleclass - the CSS style class to be used to items in the option listpublic void setMissingItemStyleclass(java.lang.String missingItemStyleclass)
missingItemStyleclass - the CSS style class to be used to missing items in the option list.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||