Home > Contents > Index >
CALLELEMENT
Processes the content of an element.
Syntax
<CALLELEMENT NAME="ELEMENT NAME" [PACKEDARGS="PACKEDARG NAMES"] [SCOPED="SCOPING OPTION/>] <ARGUMENT
NAME="ARG NAME" VALUE="ARG VALUE"/> </CALLELEMENT>Parameters
NAME (required)
- Name of the element to call.
PACKEDARGS (optional)
- A name/value pair to pass to the called element. Pairs are in the format
x=y&a=b&c=d
. This is useful if a string in this form is retrieved from a database field. It is more efficient to pass individual parameters rather than constructing a string in this form to pass values to an element.
SCOPED (optional)
- Valid options for this attribute are as follows:
GLOBAL
- the default behaviorLOCAL
- arguments passed in are restored (or destroyed) on return from the call.STACKED
- the child only sees the explicit arguments passed in and can only return values in that same namespace.Description
The
CALLELEMENT
tag processes the content of an element. The element must exist in theElementCatalog
.Variables that exist prior to
CALLELEMENT
are available to tags within the called element. Variables set within the called element are available in the parent element after theCALLELEMENT
tag. Variables can also be set using theARGUMENT
tag within theCALLELEMENT
tag or by using thePACKEDARGS
parameter.Variables for the
CALLELEMENT
tag are subject to an order of precedence. The order of precedence is relative to the location of the variable as follows:
1. Variables set in arguments
2. Variables set in scripts
3. resdetails1 and resdetails2 of the ElementCatalog
The following are examples of how the order of precedence works:
- In the following element, the
arg=3
variable is set in the resdetails1 column in the ElelementCatalog. Thearg
value with the highest order of precedence isvalue1
.
<SETVAR NAME="arg" VALUE="value2"/> ... <CALLELEMENT NAME="element name"> <ARGUMENT NAME="arg" VALUE="value1"/> </CALLELEMENT>In the following element, the arg=value3
is set in the redetails1 column in the ElementCatalog. Thearg
value with the highest order of precedence isvalue2
.
<SETVAR NAME="arg" VALUE="value2"/> ... <CALLELEMENT NAME="element name"> </CALLELEMENT>In the following element, the arg=value3
is set in the resdetails1 column of the ElementCatalog. Thearg
value with the highest order of precedence isvalue3
; this is occurs when a variable is not defined in scope before theCALLELEMENT
tag.
<CALLELEMENT NAME="element name"> </CALLELEMENT>Note: There was a bug that the caller variables were available in the callee when the scope is local. This has been fixed in version 11gR1. To go back to the previous behavior add -DuseLegacyLocalScoping=true to JVM parameter.
The tag also supports 'custom elements' feature. If there exist a custom element for passed-in 'element' value then Sites will call that custom element instead of original element.
For example, if element 'CustomElements/fatwire/ui/util/ValidateFileUpload' has been implemented as custom implementation then existing element 'fatwire/ui/util/ValidateFileUpload' will not be called when below tag executes -
<CALLELEMENT NAME="fatwire/ui/util/ValidateFileUpload">For scenario where inspite of having custom element, requirement is to ignore custom element and call original element, use brackets in element name -
<CALLELEMENT NAME="[fatwire/ui/util/ValidateFileUpload]">Above tag will execute the exact element (fatwire/ui/util/ValidateFileUpload), not the one present inside CustomElements folder.
Note: The tag isElement(elementName) does not support bracket in element name.Error Numbers
The possible values of
errno
include:
Value Description -10 No element exists. -12 Cannot evaluate element.Example
This example calls the element
SimpleTest
with the argumentsFoo
andFoo2
.<SETVAR NAME="errno" VALUE="0"/> <CALLELEMENT NAME="SimpleTest"> <ARGUMENT NAME="Foo" VALUE="Bar"/> <ARGUMENT NAME="Foo2" VALUE="Bar2"/> </CALLELEMENT> <IF COND="IsError.Variables.errno=true"> <THEN> <!--Handle error--> </THEN> </IF>You can specify
PACKEDARGS
in the following format:<SETVAR NAME="errno" VALUE="0"/> <SETVAR NAME="args" VALUE="Foo=Bar&Foo2=Bar2"/> <CALLELEMENT NAME="SimpleTest" PACKEDARGS="Variables.args"> </CALLELEMENT> <IF COND="IsError.Variables.errno=true"> <THEN> <!--Handle error--> </THEN> </IF>The parameters
Foo
andFoo2
with valuesBar
andBar2
are available to the elementSimpleTest
.See Also
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.