Jun 01, 2012, 8:11 AM
[CLOSED] JSON deserialisation issue with multicombo boxes.
I have a form panel that is submitting through to a controller method that receives the form fields and needs to deserialise it. This works fine for text fields, but for combo boxes I get an error such as:
thanks
"Error reading string. Unexpected token: StartArray. Path 'mcbBillingStatus', line 1, position 59."
The input string is typically something like this (by default): "{\"txtServiceId\":\"\",\"txtServiceName\":\"\",\"mcbBillingStatus\":[],\"txtCustomerReference\":\"\",\"txtServiceAlias\":\"\",\"mcbOperationalStatus\":[],\"txtServiceReference\":\"\",\"txtSalesOrderNumber\":\"\",\"ddtServiceType\":null,\"txtMinMonthlyAmount\":\"\",\"id64bab6e3f30086b5\":\"(MIN) - $ \",\"txtMaxMonthlyAmount\":\"\",\"idce170880d87c86b5\":\"(MAX)\",\"cmbCustomer\":null}"
as you can see, if there is no selected value in the multi combo, it just comes back as [] and fails on the JSON.deserialize call. I've tried setting the empty value attribute with no luck - it seems to be ignored altogether (perhaps this is because I have the EmptyText attribute used also?)thanks
Last edited by Daniil; Jun 08, 2012 at 2:20 PM.
Reason: Please use [CODE] tags, [CLOSED]