|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.TagSupport javax.servlet.jsp.tagext.BodyTagSupport com.bea.wlw.netui.tags.AbstractBaseTag com.bea.wlw.netui.tags.template.SetAttribute
public class SetAttribute
Set an Attribute
value defined in a template. This tag is
used in content pages to set the value of attributes defined in a template.
The attribute value will override any default value defined on the
Attribute
.
Attribute Descriptions | |||
---|---|---|---|
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
name | Yes | No | No |
The name of the Attribute in the template for which this tag sets a value for. | |||
value | Yes | No | Read Only |
The value of the Attribute. This may be either a String value or an expression. |
Attribute
,
IncludeSection
,
Section
,
Template
,
Visible
,
Serialized FormAssume a <netui-template:attribute> tag defines a value placeholder within a <td> tag
<td colspan="3" bgcolor="<netui-template:attribute name="headerColor" defaultValue="#ffffff"/>">
Now a content JSP page can control the background color of the <td>.
<netui-template:setAttribute name="headerColor" value="lightgreen"/>The HTML rendered in the browser will appear as follows.
<td colspan="3" bgcolor="lightgreen">
The <netui-template:setAttribute> tag must have a parent
Template
tag.
The target placeholder is defined by a Attribute
tag. For a value to be set
in the placeholder, the <netui-template:attribute> and
<netui-template:setAttribute> tags must have matching name
attributes.
For example, a placeholder may be defined in the template.
In the template JSP page...
<head> <title> <netui-template:attribute name="title"/> </title> </head>
Then content pages may set the value of this placeholder using the <netui-template:setAttribute> tag.
In a content JSP page...
<netui-template:setAttribute name="title" value="myContentPage1.jsp"/>
The HTML rendered in the browser appears as follows.
Rendered HTML in the browser...
<head> <title> myContentPage1.jsp </title> </head>If the <netui-template:setAttribute> tag specifies no value to be set in the placeholder, then the <netui-template:attribute> tag's
defaultValue
will be used.
<netui-template:attribute name="title" defaultValue="My Page"/>The <netui-template:attribute> tag may also be used to define placeholders within JSP and HTML tags.
In the template JSP page...
<td colspan="3" bgcolor="<netui-template:attribute name="headerColor" defaultValue="#ffffff"/>">
Field Summary |
---|
Fields inherited from class com.bea.wlw.netui.tags.AbstractBaseTag |
---|
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, JAVASCRIPT_STATUS, NETUI_UNIQUE_CNT |
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface com.bea.wlw.netui.tags.template.TemplateConstants |
---|
TEMPLATE_ATTRIBUTES, TEMPLATE_SECTIONS |
Fields inherited from interface com.bea.wlw.netui.tags.html.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 javax.servlet.jsp.tagext.BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
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 | |
---|---|
SetAttribute()
|
Method Summary | |
---|---|
int |
doStartTag()
Tag Lifecycle method called when the tag is first seen. |
String |
getName()
Return the name of the Attribute we are setting an value
for. |
String |
getTagName()
Return the name of the tag. |
String |
getValue()
Return the value value. |
protected void |
localRelease()
Reset all of the fields of the tag. |
void |
setName(String name)
Set the name of the attribute. |
void |
setValue(String value)
Set the value of the Attribute . |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
doAfterBody, doEndTag, doInitBody, getBodyContent, getPreviousOut, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
---|
getParent, setParent |
Constructor Detail |
---|
public SetAttribute()
Method Detail |
---|
public String getTagName()
AbstractBaseTag
.
getTagName
in class AbstractBaseTag
public void setName(String name)
name
of the attribute.
name
- The name of the Attribute
in the
template for which this tags sets the value.public String getName()
Attribute
we are setting an value
for.
String
value representing the name of the
Attribute.public void setValue(String value)
Attribute
. This attribute
may be assigned a read only expression.
value
- The value to use for the Attribute
in the template.public String getValue()
value
value. If the value is an
expression, the expression will be returned, not the value referred
to by the expression.
String
value representing the
Attribute
value.public int doStartTag() throws javax.servlet.jsp.JspException
Attribute
value to a HashMap
stored in the request allowing the template to access the value. If
there are errors, the error text will be placed into the attribute
value. Nothing is written into the ServletResponse
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- on errorprotected void localRelease()
localRelease
in class AbstractBaseTag
|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |