# com.bea.wlw.netui.tags.databinding.invoke
DeclareControl Class

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
Attribute | Required | Runtime Expression Evaluation | Data Bindable
--- | --- | --- | ---
controlId | No | No | No
The identifier in the PageContext where this control will be stored for use in the page.
type | No | No | No
The class name of the control to create.

Related Topics

<netui-data:callControl> Tag Sample
``CallMethod``
``MethodParameter``

Hierarchy
  `Object`
  `TagSupport`
  `BodyTagSupport`
  `AbstractBaseTag`
  `DeclareControl`

All Implemented Interfaces
  `BodyTag`, `IterationTag`, `Serializable`, `Tag`

## Field Summary

Fields from com.bea.wlw.netui.tags`.`AbstractBaseTag``
``ATTR_GENERAL`, `ATTR_GENERAL_EXPRESSION`, `ATTR_JAVASCRIPT`, `ATTR_STYLE`, `CLASS`, `ID`, `JAVASCRIPT_STATUS`, `NAME`, `NETUI_UNIQUE_CNT`, `ONCLICK`, `ONDBLCLICK`, `ONKEYDOWN`, `ONKEYPRESS`, `ONKEYUP`, `ONMOUSEDOWN`, `ONMOUSEMOVE`, `ONMOUSEOUT`, `ONMOUSEOVER`, `ONMOUSEUP`, `STYLE`, `TABINDEX``

Fields from javax.servlet.jsp.tagext`.`BodyTagSupport``
`bodyContent`

Fields from javax.servlet.jsp.tagext`.`TagSupport``
`id, pageContext`

Fields from interface javax.servlet.jsp.tagext`.`BodyTag``
`EVAL_BODY_BUFFERED, EVAL_BODY_TAG`

Fields from interface javax.servlet.jsp.tagext`.`IterationTag``
`EVAL_BODY_AGAIN`

Fields from interface javax.servlet.jsp.tagext`.`Tag``
`EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE`

## Constructor Summary

DeclareControl()

## Method Summary

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

Methods from `com.bea.wlw.netui.tags.`AbstractBaseTag``
``addTagIdMapping`, `evaluateAttributeToString`, `filter`, `filter`, `getJavaScriptUtils`, `getNearestForm`, `getScriptReporter`, `getUserLocale`, `registerTagError`, `release`, `renderAttribute`, `rewriteName`, `write``

Methods from `javax.servlet.jsp.tagext.`BodyTagSupport``
`doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent`

Methods from `javax.servlet.jsp.tagext.`TagSupport``
`doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue`

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods from interface `javax.servlet.jsp.tagext.`BodyTag``
`doInitBody, setBodyContent`

Methods from interface `javax.servlet.jsp.tagext.`IterationTag``
`doAfterBody`

Methods from interface `javax.servlet.jsp.tagext.`Tag``
`doEndTag, doStartTag, getParent, release, setPageContext, setParent`

## Constructor Detail

### DeclareControl

    public DeclareControl()

## Method Detail

### doEndTag() Method

    public int doEndTag()
         throws 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`.

Overrides
  `BodyTagSupport.doEndTag()`

#### Returns

EVAL_PAGE

#### Exceptions

``JspException``
  if an error can not be reported in the page

### doStartTag() Method

    public int doStartTag()

Start the execution of this tag. The body of this tag is not rendered.

Overrides
  `BodyTagSupport.doStartTag()`

#### Returns

SKIP_BODY

### getControlId() Method

    public String getControlId()

Get the identifier where the Control is stored in the PageContext after it is created.

#### Returns

the String identifier

### getTagName() Method

    public String getTagName()

Get the name of this tag. This is used to identify the type of this tag for reporting tag errors.

Overrides
  `AbstractBaseTag.getTagName()`

#### Returns

a constant String representing the name of this tag.

### getType() Method

    public String getType()

Get the type of Control to create.

#### Returns

the type of Control to create

### localRelease() Method

    protected void localRelease()

Reset all of the fields of this tag.

Overrides
  `AbstractBaseTag.localRelease()`

### setControlId(String) Method

    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

### setType(String) Method

    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