BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.

com.bea.wlw.netui.tags.databinding.invoke
Class CallControl

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.bea.wlw.netui.tags.AbstractBaseTag
              extended by com.bea.wlw.netui.tags.databinding.invoke.AbstractCallMethod
                  extended by com.bea.wlw.netui.tags.databinding.invoke.CallControl
All Implemented Interfaces:
HtmlConstants, Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class CallControl
extends AbstractCallMethod

A tag that is used to call a method on a control. The control on which to invoke the method is taken from the PageContext attribute map, and the given method is reflectively invoked using the parameters provided in any nested MethodParameter tags.

This tag extends the CallMethod tag, which defines additional attributes.

The controlId attribute is used to specify a Control in the PageContext attribute map; the method will be invoked on this Control. Any return value will be set in the PageContext attribute map under the resultId attribute that is provided on the CallMethod tag. In the case that the return value is a primitive type, the primitive type's object wrapper is set in the PageContext under the resultId key.

Attribute Descriptions
AttributeRequiredRuntime Expression EvaluationData Bindable
controlIdNoNoYes
A PageContext attribute name whose value is the control to call.
failOnErrorNoNoNo
A boolean that if true will cause the tag to report any method invocation errors in-line in the rendered page.
methodNoNoNo
Name of the method in the control that will be invoked.
resultIdNoNoNo
The PageContext attribute name where the result, if non-null, is stored.

See Also:
MethodParameter, CallMethod, CallPageFlow, Serialized Form
Example:
In this sample, a JSP page uses a DeclareControl tag to declare a control. Then the <netui-data:callControl> tag calls the insertProduct method on that control. The insertProduct method is called with parameters, provided by MethodParameter tags.
    <netui-data:declareControl type="dbControls.ProductsDBControl" controlId="productsDBControl"/>
  
    <netui-data:callControl controlId="productsDBControl" method="insertProduct">
        <netui-data:methodParameter value="1"/>
        <netui-data:methodParameter value='ACME RacePro Crankset'/>
        <netui-data:methodParameter value="280.00"/>
        <netui-data:methodParameter value="acme_racepro_crankset.jpg"/>
        <netui-data:methodParameter value="true"/>
    </netui-data:callControl>

Code Sample

[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/tagSamples/netui_databinding/callControl/callControl.jsp

Beadoc.see:
<netui-data:callControl> Tag Sample
Beadoc.tagdescription:

This tag is used to call a method on a control file (either a JCS or JCX file).

The controlId attribute is used to specify the control file to be called. The value returned by the method will be set in the {pageContext...} data binding context under the attribute specified by the resultId attribute.

For example, if you call a control with the following <netui-data:callControl> tag...

    <netui-data:callControl 
          controlId="helloWorldControl" 
          method="hello" 
          resultId="helloMessage" 
          />

...the result of the call is stored in the {pageContext...} data binding context under the attribute helloMessage.

The result can be retrieved with the data binding expression {pageContext.helloMessage}

   <netui:label value="{pageContext.helloMessage}"/>
In a scriptlet, the result can be retrieved by calling the getAttribute() method on the javax.servlet.jsp.PageContext object:
    <%= pageContext.getAttribute("helloMessage") %>

The <netui-data:callControl> tag must be used in conjunction with the DeclareControl tag. The <netui-data:declareControl> tag is used to give the control a controlId:

    <netui-data:declareControl 
          type="tagSamples.netui_databinding.callControl.HelloWorldControl" 
          controlId="helloWorldControl" 
          />

Then the <netui-data:callControl> refers to the control using that controlId:

    <netui-data:callControl 
          controlId="helloWorldControl" 
          method="hello" 
          resultId="helloMessage" 
          />

Note that only synchronous methods can be called with <netui:callControl>. For handling asynchronous methods see the help topic Calling Web Services and Custom Java Controls From A Page Flow


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
CallControl()
           
 
Method Summary
 String getControlId()
          Get the String identifier of the Control that on which a method will be invoked.
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 localRelease()
          Reset all of the fields of this tag.
protected  Object resolveObject()
          Get the Control whose method to invoke.
 void setControlId(String controlId)
          Set the String which identifies the Control on which a method will be invoked.
 
Methods inherited from class com.bea.wlw.netui.tags.databinding.invoke.AbstractCallMethod
addParameter, doEndTag, doStartTag, findMethod, getFailOnError, getMethod, getParameterNodes, getResultId, handleReturnValue, setFailOnError, setMethod, setResultId
 
Methods inherited from class com.bea.wlw.netui.tags.AbstractBaseTag
addTagIdMapping, containsExpression, evaluateAttributeToString, evaluateExpression, filter, filter, formatErrorString, formatString, getAttribute, getErrorsReport, getExpressionEvaluator, getJavaScriptUtils, getNearestForm, getNextId, getQualifiedBundleName, getScriptReporter, getUserLocale, hasErrors, isExpression, prepForRendering, registerAttribute, registerError, registerTagError, release, removeAttribute, renderAttribute, renderAttributes, reportErrors, rewriteName, setPageContext, updateExpression, write
 
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

CallControl

public CallControl()
Method Detail

getTagName

public String getTagName()
Get the name of this tag. This is used to identify the type of this tag for reporting tag errors.

Specified by:
getTagName in class AbstractBaseTag
Returns:
a constant String representing the name of this tag.

setControlId

public void setControlId(String controlId)
Set the String which identifies the Control on which a method will be invoked.

Parameters:
controlId - the String identifier that references the Control
Beadoc.attributedescription:
The control on which to invoke a method. This value must already be specified in a <netui-data:declareControl> tag.
Beadoc.attributesyntaxvalue:
string_controlId
Beadoc.databindable:
true

getControlId

public String getControlId()
Get the String identifier of the Control that on which a method will be invoked.

Returns:
the String identifier that references the Control

localRelease

protected void localRelease()
Reset all of the fields of this tag.

Overrides:
localRelease in class AbstractCallMethod

getObjectName

protected String getObjectName()
Get the name of the object that is the target of the invocation.

Specified by:
getObjectName in class AbstractCallMethod
Returns:
a name for the object on which the method will be invoked.

resolveObject

protected Object resolveObject()
                        throws ObjectNotFoundException
Get the Control whose method to invoke. This is an implementation of the CallMethod.resolveObject() method that looks for a Control in the PageContext attribute map of the current JSP page.

Specified by:
resolveObject in class AbstractCallMethod
Returns:
the Control on which to invoke the method
Throws:
@inheritDoc
ObjectNotFoundException - if an exception occurred attempting to resolve an object

BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.