Funny problem with select box

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
rads
New User
Posts: 17
Joined: Thu Nov 08, 2018 2:08 am
First Name: Rainer
Last Name: aus dem Spring
Company Name: iks
Zip / Postal Code: 40699
Country: Germany
Contact:

Funny problem with select box

Post by rads »

According to the documentation Choice values property may be populated with

"A simple list of values separated by just a comma (i.e. Option 1, Option 2, Option 3, etc...)."

Now one of our users had the idea to create a new record with a comma in the key.
Of course, the select box providing records from this table goes Amok :).

Any idea anybody?
User avatar
Emily
Profound Logic Staff Member
Posts: 89
Joined: Tue Jun 21, 2016 8:30 am
First Name: Emily
Last Name: Seage
Company Name: Profound Logic
Contact:

Re: Funny problem with select box

Post by Emily »

Hi rads,

This problem can be solved by use of square brackets ([]) and quotation marks. See below for an example.

The 'choices' property is setup like so (notice that 2 of the options have commas included):
image1.png
image1.png (2.55 KiB) Viewed 3208 times
Running the program results in the following for the select box:
image2.png
image2.png (4.88 KiB) Viewed 3208 times
If you are using a bound field for this, you would do something similar in your RPG program.

Hope that this helps!
Emily Seage
Support Team Lead
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Funny problem with select box

Post by Scott Klement »

Using the technique that Emily posted, if you run into any other special characters that need to be escaped (for example, double quotes in the string, or square brackets, etc) they'd be escaped according to the standard for a JSON array. Details are here: https://www.json.org/json-en.html

For example:

Code: Select all

[ "Rainer", "Emily", "Scott \"Crazy Guy\" Klement" ]
rads
New User
Posts: 17
Joined: Thu Nov 08, 2018 2:08 am
First Name: Rainer
Last Name: aus dem Spring
Company Name: iks
Zip / Postal Code: 40699
Country: Germany
Contact:

Re: Funny problem with select box

Post by rads »

Excellent :)

Is this mentioned in the documentation?

If not, please consider to mention this in the documentation for select boxes.

Thank you,

Rainer
rads
New User
Posts: 17
Joined: Thu Nov 08, 2018 2:08 am
First Name: Rainer
Last Name: aus dem Spring
Company Name: iks
Zip / Postal Code: 40699
Country: Germany
Contact:

Re: Funny problem with select box

Post by rads »

Why on earth is "dokumentation" replaced by "***"?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Funny problem with select box

Post by Scott Klement »

I was wondering the same thing about *** -- very strange
BFoster
Profound User
Posts: 50
Joined: Fri May 24, 2019 6:26 am
First Name: Ben
Last Name: Foster
Company Name: Manhattan Assurance Company
Contact:

Re: Funny problem with select box

Post by BFoster »

TFM? ... as in RTFM?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests