Appending a Page to page list after a specific row
Hi,
Inside a grid I am trying to a add an item(immediate next to the current row) on-change of a dropdown value(if the selected value equal to some 'X') .
please find the below configuration. Problem here is if i do post value or refresh section additem action is not getting triggered.
can anyone help on this issue.Thanks in advance.
Regards,
Subbarao Muthineni.
-
Like (0)
-
can you try to add to the list with (<insert>Param.int) where param.int is basically pxListSubscript +1 that way it would add it after the current line. after you add to the list with a datatransform you can then refresh the section.
Best,
Jay Hysenbegasi
sorry its been added in Pega-ProcessArchitect:07-10-17.
however, it has the same logic shared by Jay Hysenbegasi.
side note: instead of Refresh event ... could you please try Refresh list action....
Thank you!
Hi Jay Hysenbegasi,
What you told i implemented actually it should work but there is some issue when refreshing the list.
It is not giving the expected result.
Thanks,
Subbarao M.
Hi,
For Example, we have 3 rows, 1 column. User select row #2, add some data (X). Add behavior Onchange (Refresh section and add activity).
Activity:
Precondition:
- Each PageList has property Number, for example:
*****.pxResults(1).Number = 2;
*****.pxResults(2).Number = 4;
*****.pxResults(3).Number = 6;
Difference between each Number = 2;
1) local.indx =param.pyForEachCount; local.Number = pxResults(<CURRENT>).Number (row # 2)
2) pxResults(<Append>) into PageList(added last(4 empty) row ).
3) property-set. pxResults(<LAST>).number = local.Number+1.
Now we have the next:
*****.pxResults(1).Number = 2;
*****.pxResults(2).Number = 4;
*****.pxResults(3).Number = 6;
*****.pxResults(4).Number = 5; (New row)
4) Obj-Sort, after which we have the next:
*****.pxResults(1).Number = 2;
*****.pxResults(2).Number = 4;
*****.pxResults(4).Number = 5; (New row)
Hi,
For Example, we have 3 rows, 1 column. User select row #2, add some data (X). Add behavior Onchange (Refresh section and add activity).
Activity:
Precondition:
- Each PageList has property Number, for example:
*****.pxResults(1).Number = 2;
*****.pxResults(2).Number = 4;
*****.pxResults(3).Number = 6;
Difference between each Number = 2;
1) local.indx =param.pyForEachCount; local.Number = pxResults(<CURRENT>).Number (row # 2)
2) pxResults(<Append>) into PageList(added last(4 empty) row ).
3) property-set. pxResults(<LAST>).number = local.Number+1.
Now we have the next:
*****.pxResults(1).Number = 2;
*****.pxResults(2).Number = 4;
*****.pxResults(3).Number = 6;
*****.pxResults(4).Number = 5; (New row)
4) Obj-Sort, after which we have the next:
*****.pxResults(1).Number = 2;
*****.pxResults(2).Number = 4;
*****.pxResults(4).Number = 5; (New row)
*****.pxResults(3).Number = 6;
5) Recalculate Number property:
*****.pxResults(1).Number = 2;
*****.pxResults(2).Number = 4;
*****.pxResults(4).Number = 6; (New row)
*****.pxResults(3).Number = 8;
to enter a new row in a specific position you need to use (<insert>x) see my comment above also.
append will just add at the bottom of the list.
Best,
Jay Hysenbegasi
Jay Hysenbegasi, what about steps 1-5 which mentioned above by me?
Hi Artem,
I think your solution is relying on the sort to get the items lined up correctly and it might not be the case that they will from simply sorting them. I guess it could work depending on the scenario but should not count that after you issue a sort on the list they will be in the order that you want/expect.
Best,
Jay Hysenbegasi

How about first add item and then do your post value.
FYI: coping copying from school/learning's book. Thank you!
- Append : To add an element to the end (highest index value) a Value List or Page List property
- Last : To set or retrieve an element value from the end (highest index value) a Value List or Page List property, use the <LAST> index keyword
- Insert : Use the <INSERT> keyword followed by an integer to insert a new element and its value into a Value List or Page List
- Prepend: Use the <PREPEND> keyword insert a new element and its value into a Value List or Page List property as the first element.
- Current: Within a single activity step, you can set up an iteration that performs a repeated computation over a collection, such as all the elements in a Value List property. In that context, the <CURRENT> index identifies the index value for the current iteration.
Hi Subbarao,
Based on the above screenshot. You have not passed the AdjIndex to the activity. Check for AdjIndex parameter value in run time.
Since value is NULL, I guess it is appending to the end.
Regards,
Prasad
Hi Prasad,
I cannot do it because it will not fit in my scenario. If user is doing this in 3rd or 4th page then if we refresh the section we will be coming back to first page.
Thanks,
Subbarao M.