[CLOSED] JSON Decode Exception

  1. #1

    [CLOSED] JSON Decode Exception

    According to the changelog now I use FormPanelResult in my MVC application
    119. The Server AjaxFormResult has been renamed to FormPanelResult.
    In v1.x of Ext.NET in one of my request I received this json in result.responseText property:

    {success:true,extraParams:{"reboseValue":"0000,00","reboseMask":"9999,99","reboseRegex":"^\\d{0,4}\\,\\d{0,2}$","reboseRegexText":"hhhh,mm","redondeoValue":"000,00","redondeoMask":"?999,99","redondeoRegex":"^[\\ \\+\\-]{0,1}\\d{0,3}\\,\\d{0,2}$","redondeoRegexText":"hhh,mm"}}
    But now in v2.x I receive this one:

    {success:true,extraParams:{"reboseValue":0000,00,"reboseMask":9999,99,"reboseRegex":"^\\d{0,4}\\,\\d{0,2}$","reboseRegexText":"hhhh,mm","redondeoValue":000,00,"redondeoMask":"?999,99","redondeoRegex":"^[\\ \\+\\-]{0,1}\\d{0,3}\\,\\d{0,2}$","redondeoRegexText":"hhh,mm"}}
    And when I try to decode it it throws me an exception.

    Ext.decode(result.responseText)
    It seems that when I add strings with COMMA it hasn't been quoted as expected in Ext.decode
    Last edited by Daniil; Sep 28, 2012 at 4:28 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I think The problem lays here
    "reboseValue":0000,00,"reboseMask":9999,99,
    The "0000,00" and "9999,99" are not wrapped in double quotes.

    Please try to explicitly set up
    ParameterMode.Value
    for these Parameters.
  3. #3
    Hi again,

    Yes with ParameterMode.Value works and Ext.decode decode json right.

    It would be a bug fixed in v2.1 or this is the new behaviour?
  4. #4
    Now there is auto detection of parameter type. And it doesn't work well in that case.

    Generally, it would be best to always set up Mode explicitly.

    Though we will look how to fix that issue.
  5. #5
    Ok thanks, right now I would write ParameterMode

    Thanks
  6. #6
    Quote Originally Posted by Daniil View Post
    Now there is auto detection of parameter type. And it doesn't work well in that case.

    Generally, it would be best to always set up Mode explicitly.

    Though we will look how to fix that issue.
    It has been fixed in SVN. Thank you for pointing the problem out.

Similar Threads

  1. Replies: 6
    Last Post: Jul 03, 2012, 5:46 PM
  2. Replies: 1
    Last Post: Jun 08, 2010, 11:38 AM
  3. html decode on combo box
    By [WP]joju in forum 1.x Help
    Replies: 1
    Last Post: Dec 22, 2009, 6:20 AM
  4. HTML Decode using XTemplate
    By rthiney in forum 1.x Help
    Replies: 2
    Last Post: Aug 11, 2009, 2:34 PM
  5. Ext.decode on server side
    By nanosassa in forum 1.x Help
    Replies: 1
    Last Post: Jun 12, 2009, 3:00 PM

Tags for this Thread

Posting Permissions