This topic is locked

Using popup object with arrays

8/25/2021 3:06:18 PM
PHPRunner General questions
C
chandoshi authorDevClub member

Can someone help me with an issue on displaying array elements correctly in popup dialogue please.

I have 2 senarios where I am using an array to pass to the popup selection options.
Case 1: This works as expected
I am creating the array in custom-button - Client Before using push command.
When I display the resulting array using alert it shows as : "535,Yogesh Parikh,536,Pallavi Parikh"
the ctrl.dialog option is populeted using the above array and it shows only the names (2 items) in the selection window and the corresponding Id is passed to Server as selection as expected. See attached

img alt

Case 2: Does not work as expected
I am passing an array from a session variable to proxy variable and then using it in custom button-Client Before.
I am using the array in popup object ctrl.dialog.
When I show the array content via an alert they show as : "535,Yogesh Parikh,536,Pallavi Parikh" - exactly same as Case 1
When I use the array as my option variable the popup dialogue shows all four elements as separate items . How can I make it work as case 1

img alt