Discussion
Pegasystems Inc.
IN
Last activity: 10 Dec 2024 8:20 EST
Understanding TOP and embedded page in pega
An embedded page is a clipboard page that has the value of a property of mode Page. Any page on the clipboard that is not a top-level page is an embedded page.
A top-level page is a clipboard page, usually created through the Page-New method, that is not an embedded page. The system creates many top-level pages in routine, normal operation. Your activities can create other top-level pages. Most top-level pages are named, and have an associated class.
Clipboard pages that are not top-level pages are called embedded, and are defined by a property, an instance of Rule-Obj-Property.
Here ItemsList is property of type page thus is an embedded page
In a DT when Top is used it will refer to the Top most page in the hierarchy. For eg Top in the context of ItemsList(1) in the above clipboard, image will be pyWorkPage (and not Cart [AMA-EcoShop-Data-Cart] )
The table above is in the context of Data-CartProduct so if a DT is plugged-in on click on Quantity a DT of Data-CartProduct should run.
Altough TOP is not defined here in this case it is recommended to do so.When you use the TOP
keyword in the rule form, on the form's Pages & Classes tab, add a row with TOP
in the Page Name field and a class in the Class Name field.
Upon tracing we can confirm Top refers to pyWorkPage class
Note on keyword Parent:
To work with a property on the enclosing page of the current context, which is an embedded page. You can use this keyword twice to designate the grandparent page and so on (eg: parent.parent.parent.Loan(4).aproperty )
The PARENT
keyword is valid in Declare Expression rules, Declare Index rules, decision trees, map values, and decision tables, and within Java code. You can also use the PARENT
keyword in the Step page field in activities.
In a Java step of an activity, the keyword parent
refers to the parent page of the current step page, not of the primary page.
You cannot use this keyword in data transforms.