|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTagSupport
it.eng.spago.taglib.html.OptionsCollectionTag
public class OptionsCollectionTag
Tag for creating multiple <select> options from a collection. The collection may be part of the enclosing form, or may be independent of the form. Each element (SourceBean) of the collection must expose a 'label' and a 'value', the attribute names of which are configurable by attributes of this tag.
If "isLabelKey" is valorized to true the "label" is used to retrieve a message from the resource bundle.
Field Summary | |
---|---|
protected boolean |
filter
Should the label values be filtered for HTML sensitive characters? |
protected java.lang.String |
isLabelKey
Say if label are to be used as keys to retrive from bundle |
protected java.lang.String |
label
The name of the bean property containing the label. |
protected java.lang.String |
listAttribute
|
protected static MessageBundleReference |
messages
The message resources for this package. |
protected java.lang.String |
paramName
The attribute paramName is used in conjunction with
the attribute paramValue and the attribute
listAttribute to filter a SourceBeanAttribute. |
protected java.lang.String |
paramValue
|
protected java.lang.String |
property
The name of the property to use to build the values collection. |
protected java.lang.String |
value
The name of the bean property containing the value. |
Constructor Summary | |
---|---|
OptionsCollectionTag()
|
Method Summary | |
---|---|
protected void |
addOption(java.lang.StringBuffer sb,
java.lang.String label,
java.lang.String value,
boolean matched)
Add an option element to the specified StringBuffer based on the specified parameters. |
int |
doStartTag()
Process the start of this tag. |
boolean |
getFilter()
|
java.lang.String |
getIsLabelKey()
|
protected java.util.Iterator |
getIterator(java.lang.Object collection)
Return an iterator for the options collection. |
java.lang.String |
getLabel()
|
java.lang.String |
getListAttribute()
|
java.lang.String |
getParamName()
|
java.lang.String |
getParamValue()
|
java.lang.String |
getProperty()
|
java.lang.String |
getScope()
|
java.lang.String |
getStyle()
|
java.lang.String |
getStyleClass()
|
java.lang.String |
getValue()
|
void |
release()
Release any acquired resources. |
void |
setFilter(boolean filter)
|
void |
setIsLabelKey(java.lang.String isLabelKeys)
|
void |
setLabel(java.lang.String label)
|
void |
setListAttribute(java.lang.String listAttribute)
|
void |
setParamName(java.lang.String paramName)
|
void |
setParamValue(java.lang.String paramValue)
|
void |
setProperty(java.lang.String property)
|
void |
setScope(java.lang.String scope)
|
void |
setStyle(java.lang.String style)
|
void |
setStyleClass(java.lang.String styleClass)
|
void |
setValue(java.lang.String value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static MessageBundleReference messages
protected boolean filter
protected java.lang.String label
protected java.lang.String listAttribute
paramName
protected java.lang.String isLabelKey
protected java.lang.String paramName
paramName
is used in conjunction with
the attribute paramValue
and the attribute
listAttribute
to filter a SourceBeanAttribute.
In this way is possible to navigate a SourceBean to a path that
indicate a list of SourceBeanAttribute to filter; the filter is
rappresented with the pair (paramName
, paramValue
).
If the obtained attribute contain a list identified by
listAttribute
, this list is returned.
protected java.lang.String paramValue
paramName
protected java.lang.String property
protected java.lang.String value
Constructor Detail |
---|
public OptionsCollectionTag()
Method Detail |
---|
public boolean getFilter()
public void setFilter(boolean filter)
public java.lang.String getLabel()
public void setLabel(java.lang.String label)
public java.lang.String getProperty()
public void setProperty(java.lang.String property)
public java.lang.String getStyle()
public void setStyle(java.lang.String style)
public java.lang.String getStyleClass()
public void setStyleClass(java.lang.String styleClass)
public java.lang.String getValue()
public void setValue(java.lang.String value)
public int doStartTag() throws JspException
JspException
- if a JSP exception has occurredpublic void release()
protected void addOption(java.lang.StringBuffer sb, java.lang.String label, java.lang.String value, boolean matched) throws JspException
Note that this tag specifically does not
support the styleId
tag attribute, which causes the HTML
id
attribute to be emitted. This is because the HTML
specification states that all "id" attributes in a document have to be
unique. This tag will likely generate more than one
option
element element, but it cannot use the same
id
value. It's conceivable some sort of mechanism to
supply an array of id
values could be devised, but that
doesn't seem to be worth the trouble.
If "isLabelKey" is valorized to true the "label" is used to retrieve a message from the resource bundle.
sb
- StringBuffer accumulating our resultsvalue
- Value to be returned to the server for this optionlabel
- Value to be shown to the user for this optionmatched
- Should this value be marked as selected?
JspException
protected java.util.Iterator getIterator(java.lang.Object collection) throws JspException
collection
- Collection to be iterated over
JspException
- if an error occurspublic java.lang.String getIsLabelKey()
public void setIsLabelKey(java.lang.String isLabelKeys)
public java.lang.String getScope()
public void setScope(java.lang.String scope)
public java.lang.String getParamName()
public void setParamName(java.lang.String paramName)
public java.lang.String getParamValue()
public void setParamValue(java.lang.String paramValue)
public java.lang.String getListAttribute()
public void setListAttribute(java.lang.String listAttribute)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |