escape commas in oxy_combobox labels

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Doug
Posts: 28
Joined: Sat Jun 15, 2013 1:34 am

escape commas in oxy_combobox labels

Post by Doug » Thu Dec 08, 2016 7:27 pm

Is there any way to escape commas in the comma delimited values of labels in the oxy_combobox css form control function? For example: labels, "lastname\,firstname", lastname1\,"firstname1". I've tried backslashes and various forms of character entities or character numbers. They all still translate to comma before they are displayed and break the match with the number of items in the values list. Would reading the labels from an xml file with oxy_xpath make any difference? Or can I use a different delimiter instead of commas? Thanks, Doug

Doug
Posts: 28
Joined: Sat Jun 15, 2013 1:34 am

Re: escape commas in oxy_combobox labels

Post by Doug » Thu Dec 08, 2016 7:44 pm

A correction to my initial post is that my attempts so far either translate to commas before being displayed therefore breaking my match with the values list. e.g. "\," or don't translate at all remaining as a character entity or other form of character number in the list, e.g, "&#x002C;

Radu
Posts: 6205
Joined: Fri Jul 09, 2004 5:18 pm

Re: escape commas in oxy_combobox labels

Post by Radu » Fri Dec 09, 2016 9:30 am

Hi Doug,

Typically, when you use a comma in the values of a form control, the content that follows a comma is considered a new value. If you want to include a comma in the values, precede the comma with two backslashes. For example, oxy_combobox(values, '1\\, 2\\, 3, 4, edit, false) will display a combo box having the first value 1, 2, 3 and the second value 4.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Doug
Posts: 28
Joined: Sat Jun 15, 2013 1:34 am

Re: escape commas in oxy_combobox labels

Post by Doug » Fri Dec 09, 2016 7:23 pm

Perfect! Thanks Radu. I was hoping it would be that easy. Solved.
Doug

Post Reply