Escaping Commas in Dropdowns

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
rcook
New User
Posts: 13
Joined: Mon Apr 04, 2011 10:24 am
First Name: Ryan
Last Name: Cook
Company Name: StoneRiver, Inc
State / Province: Florida
Country: United States
Contact:

Escaping Commas in Dropdowns

Post by rcook »

Is there a way to escape a comma in the Choices property of a Dropdown? I have a list of values that I'd like to put into a dropdown, but some of them have commas in them and ProfoundUI is splitting them out into separate options.
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Escaping Commas in Dropdowns

Post by David »

There is not currently a way -- you'd have to scan/replace them with something else for now. However, we are aware of this problem and are working on a solution.
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Escaping Commas in Dropdowns

Post by dieter »

We have the same problem. We found out, that you can escape a comma in a Combo-Box by using ,
But this escape characters don't work in a dropdown-box. I hope, Profound can find a solution for this problem. In Germany all numbers are separated from their decimal positions by a comma. My suggestion is to escape control characters by a backslash.

Or is this problem already solved?
Dieter
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Escaping Commas in Dropdowns

Post by David »

There is now a way to do this by specifying the list in a different format.

Rather than using a comma-separated list, you can use a JSON array. For example:

Code: Select all


["Option One", "Option With , Inside", "Option With \"Quotes\" Inside"]

You'll want to give it like that, including the square brackets.

Since the data is enclosed in quotes, it's no problem to include a comma. If you need to include quotes in the data, it can be escaped as shown above. The above code gives these options:

Code: Select all

Option One
Option With , Inside
Option With "Quotes" Inside
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Escaping Commas in Dropdowns

Post by David »

Also, I wanted to point out that this format can be used with ALL properties which accept comma-separated lists in PUI.
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Escaping Commas in Dropdowns

Post by dieter »

David,

thank you! I just tried it out. Works great. Exactly what we need.

Dieter
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests