|
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.databinding.invoke.AbstractCallMethod com.bea.wlw.netui.tags.databinding.invoke.CallMethod com.bea.wlw.netui.tags.databinding.repeater.choice.ChoiceMethod
public class ChoiceMethod
A ChoiceMethod tag is used in order to choose a particular Choice
tag whose
body should be rendered for the current data item in the
Repeater
.
The ChoiceMethod tag invokes a method on an object and passes parameters from its nested
MethodParameter
tags. The value
of each of these parameters may be taken from the "current" data item using the
container.item
databinding syntax. The result of evaluating this method
is set on the RepeaterItem
through the RepeaterItem.setChoiceValue(Object)
call. The Choice
tags then reach to their RepeaterItem
to determine if
the body of a particular Choice
tag should be rendered.
Attribute Descriptions | |||
---|---|---|---|
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
failOnError | No | No | No |
A boolean that if true will cause the tag to fail if any
errors are reported invoking the method. | |||
method | No | No | No |
Name of the method in the page flow that will be invoked. | |||
object | Yes | No | Yes |
References an object with an expression on which a choice method should be invoked. | |||
resultId | No | No | No |
The PageContext attribute name where the result,
if non-null, is stored. |
Additional attributes can be found on the CallMethod
tag.
Choice
,
Serialized FormIn the following example, the <netui-data:choiceMethod> tag calls the isItemsOnSale
method, which returns a boolean value. If the return value is true, then the contents of the
<netui-data:choice value="true"> tag are rendered; if the return value is false, then the contents of the
<netui-data:choice value="false"> tag are rendered.
<netui-data:repeaterItem> <netui-data:choiceMethod object="{pageFlow}" method="isItemOnSale"> <netui-data:methodParameter value="{container.item.quantityavailable}"/> </netui-data:choiceMethod> <netui-data:choice value="true"> <tr class="row" bgcolor="#FF9999"> <td><netui:label value="{container.item.itemnumber}"/></td> <td><netui:label value="{container.item.itemname}"/></td> <td><netui:label value="{container.item.quantityavailable}"/></td> <td><netui:label value="{container.item.price}"/> Clearance Item</td> </tr> </netui-data:choice> <netui-data:choice value="false"> <tr class="row"> <td><netui:label value="{container.item.itemnumber}"/></td> <td><netui:label value="{container.item.itemname}"/></td> <td><netui:label value="{container.item.quantityavailable}"/></td> <td><netui:label value="{container.item.price}"/></td> </tr> </netui-data:choice> </netui-data:repeaterItem>
[BEA_HOME]\weblogic81\samples\workshop\SamplesApp\WebApp\tagSamples\netui_databinding\choice
Choice
tag is rendered.
The <netui-data:choiceMethod> tag makes its decision by invoking a method on an object.
(Parameters are passed to the method from nested
MethodParameter
tags. The value
of each of these parameters may be taken from the "current" data item using the expression
{container.item...}
.)Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.bea.wlw.netui.tags.databinding.invoke.AbstractCallMethod |
---|
AbstractCallMethod.ParamNode |
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.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 | |
---|---|
ChoiceMethod()
|
Method Summary | |
---|---|
int |
doEndTag()
End this tag's rendering lifecycle. |
int |
doStartTag()
Register this tag with its RepeaterItem parent. |
String |
getObject()
Get the expression that references an object on which to invoke the decision mtehod. |
protected String |
getObjectName()
Get the name of the object that is the target of the invocation. |
String |
getTagName()
Get the name of this tag. |
protected void |
handleReturnValue(Object result)
Handle any value that may be returned from the decision method. |
protected void |
localRelease()
Reset all of the fields of this tag. |
protected void |
reportErrors()
This will report an expression error. |
protected Object |
resolveObject()
Get the object on which an expression the choice method should be executed. |
void |
setObject(String object)
Set the object on which the decision method should be invoked. |
Methods inherited from class com.bea.wlw.netui.tags.databinding.invoke.CallMethod |
---|
findMethod |
Methods inherited from class com.bea.wlw.netui.tags.databinding.invoke.AbstractCallMethod |
---|
addParameter, getFailOnError, getMethod, getParameterNodes, getResultId, setFailOnError, setMethod, setResultId |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
doAfterBody, 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 ChoiceMethod()
Method Detail |
---|
public String getTagName()
getTagName
in class CallMethod
public void setObject(String object)
setObject
in class CallMethod
object
- the object on which to invoke a methodpublic String getObject()
getObject
in class CallMethod
null
if unsetprotected void localRelease()
localRelease
in class CallMethod
public int doStartTag() throws javax.servlet.jsp.JspException
RepeaterItem
parent. The RepeaterItem
will adjust its rendering lifecycle based on the presence of
a ChoiceMethod tag.
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class AbstractCallMethod
javax.servlet.jsp.JspException
- if an error is reported that can not be reported in the pageMethodParameter
public int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class AbstractCallMethod
javax.servlet.jsp.JspException
- if an error is reported that can not be reported in the pageAbstractCallMethod.getMethod()
,
AbstractCallMethod.handleReturnValue(java.lang.Object)
,
MethodParameter
,
ObjectNotFoundException
,
TypeUtils.convertToObject(java.lang.String, java.lang.Class)
,
String
protected Object resolveObject() throws ObjectNotFoundException
resolveObject
in class CallMethod
ObjectNotFoundException
protected void handleReturnValue(Object result)
RepeaterItem
so that it can be accessed by the
Choice
tags in a repeater tag's RepeaterItem
tag.
handleReturnValue
in class AbstractCallMethod
result
- the object that resulted from invoking decision methodprotected String getObjectName()
getObjectName
in class CallMethod
protected void reportErrors() throws javax.servlet.jsp.JspException
AbstractBaseTag
reportErrors
in class AbstractBaseTag
javax.servlet.jsp.JspException
|
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 |