Dynamic Lists with different return field

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

User avatar
Jez
Ebase User
Posts: 31
Joined: Thu Aug 21, 2008 11:03 am
Location: Hampshire County Council

Dynamic Lists with different return field

#1

Postby Jez » Thu Apr 09, 2020 10:45 am

Hi

I have a dynamic list that contains text in the display field, but passes back an integer (an identifier to a DB record) in the return field. The list works fine but is it possible to access the display field value as well, through FPL? This is because, I need to perform some logic based on the selected list display field value, and not the identifier in the list return field.

Eg. List contains

Display Field Return Field
Yes 1
No 2

The user selects 'No' and 2 is passed back in the return field but I would also like to access the display value selected which is 'No'.

I know I could go to the DB and retrieve the value based on the returned identifier but as the display value is already on screen it would be good if I could access it directly.

Cheers
0 x
--------------------------------------
Jez Hollinshead - Hampshire CC

Steve
Moderator
Moderator
Posts: 414
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

Re: Dynamic Lists with different return field

#2

Postby Steve » Thu Apr 09, 2020 11:32 am

Hi Jez,

you can use field.getDisplayValue() to get the selected display value.

e.g:

Code: Select all

//F1 is a dropdown list
var display = fields.F1.getDisplayValue();
var selected = fields.F1.getValue();

event.getOwner().addInfoMessage("Selected display value: " + display);
event.getOwner().addInfoMessage("Selected value: " + selected);
Kind regards

Steve
0 x

User avatar
Jez
Ebase User
Posts: 31
Joined: Thu Aug 21, 2008 11:03 am
Location: Hampshire County Council

Re: Dynamic Lists with different return field

#3

Postby Jez » Thu Apr 09, 2020 12:04 pm

Thanks for the reply Steve but is there an FPL equivalent?
0 x
--------------------------------------
Jez Hollinshead - Hampshire CC


Who is online

Users browsing this forum: No registered users and 4 guests