This tag is used to call a method on a control file (either a JCS or JCX file).
<netui-data:callControl
controlId="string_controlId"
[failOnError="boolean_failOnError"]
method="string_method"
[resultId="string_resultId"] />
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
<netui-data: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
insertProduct
method on that 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>
[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/tagSamples/netui_databinding/callControl/callControl.jsp
<netui-data:callControl> Tag Sample