Commas in CSV save format breaks
When I use the CSV format to store values for an XML Typeahead, stored values are not properly displayed when a content node is reloaded (e.g. after saving, leaving node, and entering node again).
Changing the save format to JSON fixes this issue.
Note that the CSV format is the only format that facilitates easy data importing (since it does not require the value label in the data set).
Hi @psteiner1 the CSV save format was disabled for the Typeahead pickers - the reason for this being that the pool of potential options could be vast and dependent on a supplied typeahead value - so if a CSV format was used, only the IDs would be saved, and it may not be possible to obtain the associated text.
Hello,
Thanks so much for this plugin. However I'm experiencing the same problem even if I choose JSON as the save format. I'm using the EnumRadioButtonPicker and I have a class in App_Code as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using nuPickers.Shared.EnumDataSource;
public enum Tints
{
[EnumDataSource(Key = "rgba(0, 110, 146, 0.8), rgba(0, 110, 146, 0.8)", Label = "Blue")]
Blue,
[EnumDataSource(Key = "rgba(191, 30, 6, 0.5), rgba(191, 30, 6, 0.5)", Label = "Red")]
Red,
[EnumDataSource(Key = "#2c3e50, rgba(44, 62, 80, 0.8), rgba(42, 70, 98, 0.6), rgba(44, 62, 80, 0.8), #2c3e50", Label = "Midnight")]
Midnight,
[EnumDataSource(Key = "rgba(20, 190, 50, 0.5), rgba(20, 190, 50, 0.5)", Label = "Green")]
Green,
[EnumDataSource(Key = "rgba(191, 93, 6, 0.5), rgba(191, 93, 6, 0.5)", Label = "Orange")]
Orange
}
The selected value for my "Tint" property saves correctly and is retrievable in the view, but when I return to the content to edit it again (or refresh the edit page for that content), the selected radio button isn't selected anymore. The same problem happens if I use a dropdown instead of radio buttons.
I'm using Umbraco 7.2beta1 and nuPickers 1.2.1.0.
On another note, the XML save format actually remembers my selected value perfectly, when I return to edit content. However, the XML save format breaks Archetype's JSON data, which is a package I sometimes use. Note: I'm not using the above Tint nuPicker inside Archetype, it's simply directly a property of my "topic page" document type (i.e. I tried to remove as many variables as possible to find what the issue could be).
I've figured out why my use case doesn't work with JSON. It's because my keys (which are basically just css rules) have commas in them. a workaround I have is to swap the commas to underscores in the enum strings, and then on the view, swap the commas back in.
Hi @oooshola, thanks for pointing that out - will have a look at the JSON encoding to ensure it doesn't break with commas.
@Hendy I somehow managed to get a Typeahead converter to have csv as the setting which broke a whole bunch of stuff. v1.5.2
I'm able to setup a Typeahead picker saving as CSV.
nuPickers version: 1.5.3 Umbraco version: 7.4.3 Type: nuPickers.JsonTypeaheadListPicker
Happening today.
Hi @Hendy, what is the latest on this issue? We are using a dotnetcheckbox picker for tags in Umbraco. Any values with commas are not being persisted on save and publish. Any fixes or workarounds for this?
Cheers