I have this sending through the value to a String array, but it appears in my action as a single element in the array with comma delimited values. My questions are:
Is there a better way to do this?
Is there a way to get an actual array passed through to my action?
AFAIK there's no magic that will automatically convert a CSV string into an array.
There's no way to pass "an array": the ONLY thing that browsers send back to servers are strings. You could write a converter that makes it into an array (and donate it to the S2 project), but you'd have to specify the type in code or configs, so it might not be a general-purpose thing.
Another option is to create multiple hidden fields with the same name; S2 will gather those and set them on a collection property (maybe array too, but I don't know that for sure). If order is significant you'd need to name them appropriately, using array syntax notation for the field names.
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop