Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Beta2
    • Fix Version/s: 2.0.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ACE

      Description

      The ACE components use JSON escaping to pass parameters from the server to the client, specifically the JSProps and JSFProps parameters. The string escaping adds quotes, and escapes quotes, but also escapes backslashes and forward slashes. In the browser, the escape sequence for the forward slashes remains, as evidenced by inspecting the thumbUrl property on sliderEntry. We need to do some escaping, so that javascript values can exist within an html tag's attribute value.

      The solution need not specifically be JSON. We could do less escaping, that's non-JSON, or we could use YUI code to JSON unescape the values.

        Activity

        Mark Collette created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Salesforce Case []
        Assignee Priority P2
        Assignee Yip Ng [ yip.ng ]
        Hide
        Mark Collette added a comment -

        This is the code in JSONBuilder that causes the issue. This illustrates the need for JSON unescaping in the browser.

        public JSONBuilder entry(String key, String value, boolean isStringLiteral)

        { ... value = value.replace("/", "\\/"); ... }
        Show
        Mark Collette added a comment - This is the code in JSONBuilder that causes the issue. This illustrates the need for JSON unescaping in the browser. public JSONBuilder entry(String key, String value, boolean isStringLiteral) { ... value = value.replace("/", "\\/"); ... }
        Mark Collette made changes -
        Salesforce Case []
        Description The ACE components use JSON escaping to pass parameters from the server to the client, specifically the JSProps and JSFProps parameters. The string escaping adds quotes, and escapes quotes, but also escapes backslashes and forward slashes. In the browser, the escape sequence for the forward slashes remains, as evidenced by inspecting the thumbUrl property on sliderEntry. We need to do some escaping, so that javascript values can exist within an html tag's attribute value.

        The solution need not specifically be JSON. We could do less escaping, or we could use YUI code to JSON unescape the values.
        The ACE components use JSON escaping to pass parameters from the server to the client, specifically the JSProps and JSFProps parameters. The string escaping adds quotes, and escapes quotes, but also escapes backslashes and forward slashes. In the browser, the escape sequence for the forward slashes remains, as evidenced by inspecting the thumbUrl property on sliderEntry. We need to do some escaping, so that javascript values can exist within an html tag's attribute value.

        The solution need not specifically be JSON. We could do less escaping, that's non-JSON, or we could use YUI code to JSON unescape the values.
        Hide
        Ken Fyten added a comment -

        Try to leverage a YUI3 utility for JSON string unescaping in the client.

        Show
        Ken Fyten added a comment - Try to leverage a YUI3 utility for JSON string unescaping in the client.
        yip.ng made changes -
        Attachment screenshot-01.png [ 12704 ]
        yip.ng made changes -
        Attachment screenshot-02.png [ 12705 ]
        Hide
        yip.ng added a comment - - edited

        var JSON = YAHOO.lang.JSON,
        var jsonStr = JSON.stringify(jsProps, ["selectedDate"]);
        console.log(jsonStr);
        var selectedDate = JSON.parse(jsonStr).selectedDate;
        console.log(selectedDate);

        See screenshots 1 and 2 for the input and output.

        To process all values, leave out 2nd param. in stringify().

        To process multiple specific values, add key names to the 2nd param. (array of key names) in stringify().

        (But date time entry works fine even without going through all these.)

        Show
        yip.ng added a comment - - edited var JSON = YAHOO.lang.JSON, var jsonStr = JSON.stringify(jsProps, ["selectedDate"] ); console.log(jsonStr); var selectedDate = JSON.parse(jsonStr).selectedDate; console.log(selectedDate); See screenshots 1 and 2 for the input and output. To process all values, leave out 2nd param. in stringify(). To process multiple specific values, add key names to the 2nd param. (array of key names) in stringify(). (But date time entry works fine even without going through all these.)
        yip.ng made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Salesforce Case []
        Fix Version/s 2.0.0 [ 10230 ]
        Assignee Priority P2
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            yip.ng
            Reporter:
            Mark Collette
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: