How to set data into PageList using java Step in Activicty

I have a PageList by name MyPageList which has got two Properties
by name SNO and Name .

I am trying to populate Data to MyPageList using java Step under Activicty

I have tried as shown below

  1. ClipboardPage tmp = tools.findPage("pyWorkPage");
  2. ClipboardProperty zList=tmp.getProperty("MyPageList");
  3. ClipboardPage cd = tools.getThread().createPage("TEK-RouterEx-Data-Heros", "currentDevice");
  4. cd.putString("HeroName","1");
  5. zList.add(cd);

The Exception Stack trace is

Caused by: Section 'Test123' execution error on page 'pyWorkPage' of class 'TEK-RouterEx-Work-FirstCase'. : The reference .MyPageList.HeroName is not valid. Reason: list property 'MyPageList' must have an index
at com.pegarules.generated.html_section.ra_stream_test123_f9d3e2801dc82f66824ceff5acd763a5.execute(
at com.pega.pegarules.session.internal.mgmt.Executable.getStream(
at com.pega.pegarules.session.internal.mgmt.autostreams.AutoStreamRuleRuntime.getSectionStream(
... 158 more
Caused by: The reference .MyPageList.HeroName is not valid. Reason: list property 'MyPageList' must have an index
at com.pegarules.generated.html_section.ra_stream_test123_f9d3e2801dc82f66824ceff5acd763a5.pxDropdown_1

Could you please tell me how to resolve this

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.


Keep up to date on this post and subscribe to comments

July 11, 2017 - 9:04am


The section reference should be .MyPageList(x).HeroName instead of .MyPageList.HeroName. .MyPageList.HeroName signifies MyPageList is a property of type page and not a pagelist.

Java code looks correct.

July 11, 2017 - 9:22am
Response to SwarnenduM

Thanks for the answer , could you please post a code snippet as how to achive this? I am getting confused. How can i use x say 1 in my example 

July 11, 2017 - 12:17pm
Response to RaviK518

Pagelist is mainly used to display repeating data. You should use repeating layout (grid) to display the HeroName property and the repeating should be done on MyPageList property.

If you are not using grid, then  you can hard code the value in the cell as .MyPageList(1).HeroName with a text property control.

August 30, 2017 - 1:20am
Response to SwarnenduM

  Hi Swarnendu,

  I have a similar requirement where i need to parse a column data having comma separated values into a pagelist. I am trying to do this using Java. I am not able to write the code for how to insert a particular value to a pagelist.

For example, MyPageList.pxResults(1).myProperty

September 8, 2017 - 3:22am
Response to ChiranjeetM


Thank you for posting your query in the PSC. This looks like an inactive post and hence, we suggest you create a new post for your query. Click on the Write a Post button that’s available on the top right pane of this page. Once created, please reply back here with the URL of the new post.

You may also refer this discussion link as a reference in the new thread

We have also sent you a private message opening up a communication channel in case you have any further questions.

Vidyaranjan | Community Moderator | Pegasystems Inc.