netui-data:declareControl Tag

<netui-data:declareControl> Tag

This tag is used in conjunction with the <netui-data:callControl> tag to call methods on a Java control.

Syntax

<netui-data:declareControl
    controlId="string_controlId"
    type="" />

Description

This tag is used in conjunction with the <netui-data: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.

Attributes

controlIdThe attribute on the PageContext object where this control will be stored.
 
RequiredSupports runtime expression evaluationData bindable
YesNoNo

typeThe class name of the control.
 
RequiredSupports runtime expression evaluationData bindable
YesNoNo

Sample

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 <netui-data: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

Related Topics

<netui-data:callControl> Tag Sample

<netui-data:callMethod> Tag

<netui-data:methodParameter> Tag