Page 1 of 1

How to get a PRIM_LIST with a property

Posted: Mon Sep 24, 2018 11:12 pm
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

Re: How to get a PRIM_LIST with a property

Posted: Tue Sep 25, 2018 12:48 am
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

Re: How to get a PRIM_LIST with a property

Posted: Wed Nov 15, 2023 7:41 pm
by MARCOREMMEDATA
Coul you publish the source code of

xDemoWebPassingWorkingLists

and

xDemoWebPassingWorkingListsEmployeeItem.

????

Re: How to get a PRIM_LIST with a property

Posted: Wed Nov 15, 2023 8:45 pm
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 37295 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 37295 times

Kind regards,
René