Question


RABO BANK
NL
Last activity: 22 Feb 2016 10:17 EST
Looping in HTML
Hi ,
I want to Loop two Page-List properties in HTML, can you please suggest me the syntax.
Thanks
Suresh Chella
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution


Pegasystems Inc.
GB
You might want to look at using the 'scratchpad' mechanism available for Pega Tags: where you can stash/retrieve values for later use.
I haven't tried this with 'dynamic' values, but it might be something to look into ? (Also: the help seems to suggest this works by using Javascript (clientside) so this also might not suit your requirement...)
The example usage in the help is:
To save:
<pega:save name="company" value="Pegasystems Inc."/>
To retrieve/reference:
<pega:reference name="$save(company)"/>
See:
prhelp/procomhelpmain.htm#jsp/save/jspsave.htm
prhelp/procomhelpmain.htm#jsp/referencingproperties.htm


Pegasystems Inc.
GB
To loop through complex PRPC Property/Page Types in an HTML rule - you can use the 'forEach' Pega Tag.
See this post here for an example of doing this: Re: Generate pdf dynamically with specific values from Pega UI
For convenience here's an example of the 'forEach' tag in use from that post:
<pega:forEach name="D_ChemList.pxResults"> <tr> <td><p:r n="$THIS.Name" m="literal"/></td> <td><p:r n="$THIS.AtomicNumber" m="literal"/></td> <td><p:r n="$THIS.Block" m="literal"/></td> <td><p:r n="$THIS.Description" m="literal"/></td> <td><p:r n="$THIS.Group" m="literal"/></td> <td><p:r n="$THIS.Occurrence" m="literal"/></td> <td><p:r n="$THIS.Period" m="literal"/></td> <td><p:r n="$THIS.State_at_STP" m="literal"/></td> <td><p:r n="$THIS.Symbol" m="literal"/></td> </tr> </pega:forEach>
If you need to iterate through two complex types: you can nest the tags.
To loop through complex PRPC Property/Page Types in an HTML rule - you can use the 'forEach' Pega Tag.
See this post here for an example of doing this: Re: Generate pdf dynamically with specific values from Pega UI
For convenience here's an example of the 'forEach' tag in use from that post:
<pega:forEach name="D_ChemList.pxResults"> <tr> <td><p:r n="$THIS.Name" m="literal"/></td> <td><p:r n="$THIS.AtomicNumber" m="literal"/></td> <td><p:r n="$THIS.Block" m="literal"/></td> <td><p:r n="$THIS.Description" m="literal"/></td> <td><p:r n="$THIS.Group" m="literal"/></td> <td><p:r n="$THIS.Occurrence" m="literal"/></td> <td><p:r n="$THIS.Period" m="literal"/></td> <td><p:r n="$THIS.State_at_STP" m="literal"/></td> <td><p:r n="$THIS.Symbol" m="literal"/></td> </tr> </pega:forEach>
If you need to iterate through two complex types: you can nest the tags.
See the help sections entitled: "Stream processing of JSP tags" and "JavaServer Pages tags" for more information on using Pega Tags.
http://<yourprpc:port>/prhelp/procomhelpmain.htm#jsp/alphaList.htm
Cheers
John


RABO BANK
NL
Hi John,
Thanks for you reply. My problem is a bit different.
I have a nested loop where I have to compare property value from outer loop with another value in the inner loop. If it matches, then I need to print the value on the screen. So far I am unable to find a way to store and retrieve the property from outer loop in a local variable that I can use to compare with the value in inner loop.
Thanks
Suresh
Accepted Solution


Pegasystems Inc.
GB
You might want to look at using the 'scratchpad' mechanism available for Pega Tags: where you can stash/retrieve values for later use.
I haven't tried this with 'dynamic' values, but it might be something to look into ? (Also: the help seems to suggest this works by using Javascript (clientside) so this also might not suit your requirement...)
The example usage in the help is:
To save:
<pega:save name="company" value="Pegasystems Inc."/>
To retrieve/reference:
<pega:reference name="$save(company)"/>
See:
prhelp/procomhelpmain.htm#jsp/save/jspsave.htm
prhelp/procomhelpmain.htm#jsp/referencingproperties.htm


Pegasystems Inc.
GB
Additionally: maybe you could create a third data structure : and populate this based on the match of the 'inner' and 'outer' values. Using a Data Transform to produce the third structure ?
Then you could simplify your HTML output just to loop through the third-structure you built in the DT ?


RABO BANK
NL
This one helped, thanks John


Pegasystems Inc.
GB
Hi Suresh,
Thanks - just to be clear: which approach did you opt for ? Using the PegaTags 'save' option or the Data Transform option ?
Cheers
John


RABO BANK
NL
Pega Tags Save


RABO BANK
NL
Hi jhon,
Can you please help on me the following case.
i know the syntax for exact match condition
<pega:when test=".Color == 'RED' " ></pega:when >
What is the syntax for "Contains or Like " ??


Hi Suresh,
Please start a new post for this question to get more specific responses!
Regards,
Lochan | Online Community Moderator | Pegasystems Inc.


Hcl Technologies
IN
.


RABO BANK
NL
Hi Sivanarayana
I cant see your reply