Use the save tag to pass values among multiple HTML
definitions that stream processing combines to generate a
single output stream.
For example, use the save tag to save the value
"Pegasystems Inc." and store it in a scratchpad
variable named company.
<pega:save name="company"
value="Pegasystems Inc." />
Later in the stream, you can use the $save()
function to look up the saved value on the scratchpad and
display the saved value.
<pega:reference
name="$save(company)" />
The save tag can save values determined dynamically at
runtime. For example:
<pega:forEach
name=".pxResults">
<pega:withEmbedded
name="this.address" >
<pega:save
name="currentAddress" ref="$this-value"
/>
</pega:withEmbedded>
</pega:forEach>
In the syntax presentations below:
- Square bracket characters
[
and
]
define optional parts of the tag. Do not
type the brackets.
- JSP tag delimiters <pega and
/
> mark
the start and end of the tag.
- Replace any text in italics with your choice of value
of that type.
<pega:save
name="anyname"
value="value"
append="text"
appendRef="aref"
prepend="text"
prependRef="aref"
ref="indirect
reference"/>
The name
attribute is required. Include
either the value
or ref
attribute.
Attribute
|
Value
|
name
|
A text string of your choosing, used for later
retrieval. Choose a name that is unique for each save
operation. (If you save using the name FUM and later save
FUM again, the more recent value overwrites the earlier
value.) |
value
|
Optional. A constant text string representing the
value to be saved and associated with the name. |
append
|
Optional. Enter literal text to be appended after the
value of the name attribute. |
appendRef
|
Optional. Enter a property reference that at runtime
evaluates to text to be appended after the value of the
name attribute. |
prepend
|
Optional. Enter literal text to be prepended before
the value of the name attribute. |
prependRef
|
Optional. Enter a property reference that at runtime
evaluates to text to be prepended before the value of the
name attribute. |
ref
|
Optional. Identifies a source of text for the value,
determined at runtime. See How to reference
properties indirectly in JSP tags. |