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 DeclareControl

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.DeclareControl
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 DeclareControl
extends AbstractBaseTag

Declare a control that is stored in the PageContext attribute map. The declareControl tag creates an instance of a Control that can be invoked by the CallControl tag and is valid for the duration of the page.

A control can be referenced from a control project or from the current webapp; if referencing a control in the former location, simply specify the type attribute as the class name of the Control's public interface.

Two control types may be referenced by this tag, .jcx and .jcs. The default control type is .jcx, but .jcs Control instances that automatically create their own control interfaces may also be used.

The declared Control instance is stored in the PageContext attribute map under the key controlId.

Any errors reported by this tag during its lifetime, including those accessing the Control's interface class or ensuring the runtime existence of the control, are reported in the JSP page.

Attribute Descriptions
AttributeRequiredRuntime Expression EvaluationData Bindable
controlIdNoNoNo
The identifier in the PageContext where this control will be stored for use in the page.
typeNoNoNo
The class name of the control to create.

See Also:
CallMethod, MethodParameter, Serialized Form
Example:
In this sample, a JSP page uses a <netui-data:declareControl> tag to declare a control. Then the <netui-data:callControl> tag calls the insertProduct method on the 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 in conjunction with the CallControl tag to call methods on a Java control. The <netui-data:declareControl> tag creates an instance of a control that can be invoked by the <netui-data:callControl> tag and is valid for the duration of the JSP page.

A control can be referenced from a control project or from the current web application; if referencing a control in the former location, simply specify the type attribute as the class name of the control's public interface.

Two control types may be referenced by this tag, JCX and JCS. The default control type is JCX, but JCS control instances may also be used.

The declared control instance is stored in the javax.servlet.jsp.PageContext object under the property specified by the controlId attribute.

Any errors reported by this tag during its lifetime, including those accessing the control's interface class or ensuring the runtime existence of the control, are reported in the JSP page.


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
DeclareControl()
           
 
Method Summary
 int doEndTag()
          Creates an instance of a Control and places it in the PageContext attribute map.
 int doStartTag()
          Start the execution of this tag.
 String getControlId()
          Get the identifier where the Control is stored in the PageContext after it is created.
 String getTagName()
          Get the name of this tag.
 String getType()
          Get the type of Control to create.
protected  void localRelease()
          Reset all of the fields of this tag.
 void setControlId(String controlId)
          Set the identifier where the Control is stored in the PageContext after it is created.
 void setType(String type)
          Set the type of Control to create.
 
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

DeclareControl

public DeclareControl()
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 identifier where the Control is stored in the PageContext after it is created.

Parameters:
controlId - the String identifier
Beadoc.attributedescription:
The attribute on the PageContext object where this control will be stored.
Beadoc.attributesyntaxvalue:
string_controlId
Beadoc.databindable:
false

getControlId

public String getControlId()
Get the identifier where the Control is stored in the PageContext after it is created.

Returns:
the String identifier

setType

public void setType(String type)
Set the type of Control to create. This should be a String that represents the fully specified class name of the Control to create.

Parameters:
type - the type of Control to create
Beadoc.attributedescription:
The class name of the control.
Beadoc.attributesyntaxvalue:
Beadoc.databindable:
false

getType

public String getType()
Get the type of Control to create.

Returns:
the type of Control to create

localRelease

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

Overrides:
localRelease in class AbstractBaseTag

doStartTag

public int doStartTag()
Start the execution of this tag. The body of this tag is not rendered.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
SKIP_BODY

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Creates an instance of a Control and places it in the PageContext attribute map. Any errors that occur while creating the Control are reported by the tag to the page. If the Control creation is successful, the control instance is stored in the PageContext's attribute map under the key controlId.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
EVAL_PAGE
Throws:
javax.servlet.jsp.JspException - if an error can not be reported in the page

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