Reference directive |
Use the Reference directive to display the values of properties, to allow users to enter values for properties, and to insert parameter values.
The output of the Reference directive uses the HTML Property rule associated with this property. For example, if the property's HTML Property rule (identified in the Property Stream field of the Property form) contains HTML code for a selection box, the property displays as a selection box. In unusual situations, you can override the output by using a variant of the Reference directive.
The pega:reference JavaServer Page tag provides a functionally identical capability. See JSP Tags — reference.
To display the value of a Single Value
property that's on the primary page:
{.myProperty}
<pega:reference name="myProperty" />
To display the value of a property on another page:
{myPage.myProperty}
<pega:reference name="myPage.myProperty" />
If the property has a mode of Value List
or
Value Group
, use an index (subscript) to
identify one element in the list or group:
{myPage.myProperty(1)}
{myPage.myProperty(mySubscript)}
To allow a user to update or enter the value for a
Single Value
property, use the
INPUT
keyword. For clarity, add the optional
AS
keyword or the AS
keyword and an
equal sign. These three examples are equivalent:
{.myProperty INPUT}
{.myProperty AS INPUT}
{.myProperty AS = INPUT}
Use the Param
keyword to identify an activity
parameter value.
{Param.myParameter}
In the syntax presentations below:
[
and
]
define optional parts of the directive. Do
not type the brackets.{
and
}
mark the start and end of the
directive.{[REFERENCE][[page].]property[(index)][AS [=]][option]}
The dot before the property is optional if
page is not specified. The option is one of
these optional keywords. If you omit any keyword, processing
assumes DISPLAY
. values. (You can spell out a
keyword or use any prefix, such as I
,
IN
, or INP
for INPUT
.)
Overriding HTML associated with a property
To cause a property's value to appear differently in different HTML pages or different applications, you can override the HTML Property rule normally associated with the property.
This uses the special syntax:
{[REFERENCE][[page].]property[(index)] mode [ =] stream-name}
where mode is INPUT
or
DISPLAY
and stream-name identifies an
HTML Property rule.
To do this:
INPUT
keyword or the
DISPLAY
keyword.To make this value appear in an input field (modifiable),
use the INPUT
keyword with the name of the HTML
Property rule (Rule-HTML-Property rule type) that is to
override the one referenced in the property rule.
To make the value appear display-only, use the
DISPLAY
keyword with the name of the HTML
Property rule that is to override the one referenced in the
property rule.
Examples:
{.myProperty INPUT Rule-HTML-Property instance}
{.myProperty DISPLAY Rule-HTML-Property instance}
Replace the italicized Rule-HTML-Property instance with the name of the Rule-HTML-Property instance that is to override the one referenced in the property.
If you find it easier, type an equal sign between
DISPLAY
or INPUT
and the
stream-name.
{.myProperty DISPLAY = Rule-HTML-Property instance}
If a property name matches a directive name
In rare cases, the name of your custom property is the
same as the name of a directive. In this case, either include
the REFERENCE
keyword or enter white space
between the opening delimiter and the reference. For example,
if your property is named WHEN, use the
REFERENCE
keyword:
{REFERENCE .WHEN}
{REFERENCE myPage.myProperty(1)}