Links may not function; however, this content may be relevant to outdated versions of the product.
How to identify parameters for HTML Property rules
Summary
Version 4.2SP6 makes it easier to use parameters with HTML Property rules (Rule-HTML-Property rule type).
A Parameters tab on the rule form identifies any parameter values referenced in the HTML code on the HTML tab.
Using parameter-based HTML Property rules improves flexibility and reduces the number of distinct HTML Property rules you need to build and maintain in your application.
Suggested Approach
A new tab on the HTML Property rule form labeled Parameters identifies the parameters used in the HTML code, and the JavaScript data type of each.
As you create an HTML Property rule, for each parameter you reference in the HTML code, identify that parameter on the Parameters tab.
V4.2SP6 does not validate the Parameters tab against the HTML code. It is your responsibility to ensure that every parameter referenced in the code is also listed on the Parameters tab.
Setting Parameter Values
Once defined, you can call an HTML Property rule by using the reference JSP tag in any HTML rule, as the value of the format attribute.
Example:
<pega:reference name=".Currency" mode="display" format="Currency2"/>
In this example, the HTML property rule Currency2 is used to format the value of the .Currency property.
You can set values for the HTML Property rule parameters within the reference JSP tag by using the pega:param tag. For example:
<pega:reference name=".Currency" mode="display" format="Decimal">
<pega:param name="ThousandsSeparator" value="-1"/>
<pega:param name="Precision" value="3"/>
<pega:param name="Locale" value="en-us"/>
/pega:reference>
Some parameters are optional; others may be required to have a non-blank value.
At design time, when you save the HTML rule containing this tag, the system validates the parameters listed in the pega:param JSP tag against those listed on the Parameters tab of the HTML Property rule.
At runtime during execution of stream processing, when the system encounters this pega:reference tag in the HTML code, it:
- Creates a new parameter page
- Adds the parameter name-value pairs to the new parameter page
- Uses these values in interpreting the HTML and JavaScript code in the HTML Property rule execution.