You are here: Reference > Streams and JSP > JSP Tags > How to reference properties indirectly in JSP tags

How to reference properties indirectly in JSP tags

In the reference, when, withReference, and forEach tags, you can reference properties indirectly rather than by name in JavaServer Page tags.

When you reference a property indirectly, you're referring to the current active property. Use any of these to set up a property as the active property.

Using symbolic values

After your HTML code has established the active property, use symbolic values (keywords) to reference the property indirectly. Use these symbolic values in the reference, when, forEach, and with JSP tags.

Symbolic value

Description

$this

Use $this in the withReference, when, and forEach tags to identify the current page.

$this-value

Use $this-value in the withReference, when, and forEach tags to identify the value of a (scalar) current active property.

param.parameter-name

Use this keyword to refer to the current value of a parameter on the current parameter page of the activity. Example:

<input type=hidden name=<pega:reference name="param.UserID"/> value="VANDJ" >

$this-name

Use $this-name in an HTML tag in the reference tags, to display the name of the active property.

For example, if you have a selection box that lets a user choose an account type, and Account_Type is the active property, use the active property as the name of the selection box. That way, the user's choice becomes the value for the property named Account_Type:

<SELECT NAME="<p:r n="$this-name" />" >
  <OPTION VALUE="Checking">Checking Account
  <OPTION VALUE="Savings">Savings Account
</SELECT>

This keyword can't be used within JSP tags other than pega:reference or p:r.

$this-definition(myProperty)

Use $this-definition in the reference tag to display the value of a property in the Rule-Obj-Property definition of the active property.

For example, to display the value of the pyLabel (Short Description) for the active property, use:

<pega:reference name="$this-definition(.pyLabel)" />

This symbolic value is frequently used to specify the maximum length or expected size.

$this-message

Use $this-message in the reference tag to display messages associated with the active property.

$this-qualifier

Use $THIS-QUALIFIER in the reference tag to display a property qualifier (Rule-Obj-Property-Qualifier rule type) associated with the active property.

$PAGE-NAME

Use $PAGE-NAME in the reference tag to display the name of the base page.

The base page is the same as the primary page, if it has not been changed by the with tag. If the with tag has changed the primary page, the base page is the page established by the with tag.

$PAGE-CLASS

Use $PAGE-CLASS in the reference tag to display the name of the class of the base page.

The base page is the same as the primary page if it has not been changed by the with tag. If the with tag has changed the primary page, the base page is the page established by the with tag.

$PAGE-MESSAGE

Use $PAGE-MESSAGE in the reference tag to display page messages. Page messages are associated with the current base page, not with one property on that page.

$PAGE-ALLMESSAGES

Use $PAGE-ALLMESSAGES in the reference tag to display all messages associated with the (current) base page.

$PAGE-DEFINITION
(propertyname)

Use this keyword to supply the named property from the Rule-Obj-Class instance that corresponds to the class of the current page.

$SAVE(name)

Use $SAVE(name) in the reference tag to retrieve and display the scratchpad value associated with name.

$STREAM-DEFINITION (property)

Identifies the named property of the current stream definition.

$STREAM-HANDLE

Identifies the handle of the stream definition.

Qualifying symbolic values

Use this syntax to qualify the value of the $THIS symbol when the current property is an aggregate:

Symbolic Value

Description

$THIS.property-reference

If the mode of the property is Page,

<pega: reference name= "$THIS.myProperty" />

identifies the value of myProperty within that page.

JavaServer Page Tags