How to get a PRIM_LIST with a property

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
sotos
Posts: 31
Joined: Fri Feb 09, 2018 11:25 pm

How to get a PRIM_LIST with a property

Post by sotos »

Hello,

I would like to know how to pass a PRIM_LIST with a property (or is there another way) and fill it from a reusable to another

e.g. In the 1st reusable (#WEBx_C_INFO_PL) I define a list:

Define_Com Class(#PRIM_LIST) Name(#POLLST) Displayposition(2) Left(0) Parent(#ListPanel) Tabposition(2) Top(43) Width(1025) Height(222)
Define_Com Class(#PRIM_LIST.String) Name(#PLCOD) Columncaption('A') Columnwidth(139) Displayposition(7) Parent(#POLLST) Columncaptiontype(Caption) Source(#CVRCOD) Displayalignment(Center)
Define_Com Class(#PRIM_LIST.Number) Name(#PLDSC) Columncaption('B') Columnwidth(97) Displayposition(8) Parent(#POLLST) Columncaptiontype(Caption) Source(#CVRDSC) Displayalignment(Center)

then I define a property for the list:

Define_Pty Name(PR1) Get(*REFERENCE #POLLST)

however when I call the property from the second reusable and try to fill the list:

#CVRCOD := "aa"
#CVRDSC := "bb"

Add_Entry To_List(#WEBx_C_INFO_PL.PR1)

the webpage crashes:

JavaScript Syntax Error:

Unexpected token ?


thanks,
Sotiris
Pablo
Posts: 48
Joined: Wed Dec 02, 2015 10:35 am

Re: How to get a PRIM_LIST with a property

Post by Pablo »

Hi Sotiris,

You can't pass around a PRIM_LIST as a component.

You must define the list as a reusable part with certain attributes.

There is an example of this in the shipped web page example: xDemoWebPassingWorkingLists where the list is defined in component xDemoWebPassingWorkingListsEmployeeItem.

Regards,
Pablo
User avatar
MARCOREMMEDATA
Posts: 14
Joined: Mon Apr 11, 2022 4:48 pm
Location: ITALIA
Contact:

Re: How to get a PRIM_LIST with a property

Post by MARCOREMMEDATA »

Coul you publish the source code of

xDemoWebPassingWorkingLists

and

xDemoWebPassingWorkingListsEmployeeItem.

????
MARCO ROSSI | Software Developer Sr. - Software Production
René Houba
Posts: 220
Joined: Thu Nov 26, 2015 7:03 am

Re: How to get a PRIM_LIST with a property

Post by René Houba »

Hi Sotiris,

I can share these codes over here, but if you do in VL a Partition Init and import all our Sample Material:
Sample Material (1).PNG
Sample Material (1).PNG (62.52 KiB) Viewed 37287 times


You will have these sample + all the other (lost off) sample material data:
Sample Material (2).PNG
Sample Material (2).PNG (48.28 KiB) Viewed 37287 times

Kind regards,
René
Post Reply