Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DynamicForm readOnlyDisplay:"static" doesn't html encode values

    Starting from this example:
    https://www.smartclient.com/smartcli...rmLayoutTitles

    I use this form:
    Code:
    isc.DynamicForm.create({
        ID: "exampleForm",
        width: 250,
        readOnlyDisplay:"static",
        fields: [
            {name: "username",
             title: "Username",
             type: "text",
             canEdit:false,
             defaultValue: "<NaN"
            },
            {name: "username2",
             title: "Username2",
             type: "text",
             canEdit:false,
             defaultValue: "<NaN"
            },
        ]
    });
    I see this:
    Click image for larger version

Name:	Untitled.png
Views:	186
Size:	5.0 KB
ID:	249850

    i.e., it is not html encoding the displayed text. If I comment out the "readOnlyDisplay:static" line, then I see this:

    Click image for larger version

Name:	Untitled2.png
Views:	175
Size:	7.9 KB
ID:	249851


    In my real code, the DOM is getting messed up somehow (the defaultValue is "<N/Aa") but I couldn't figure out how to reproduce that in your showcase so here's a screencap of the dom.
    Click image for larger version

Name:	Untitled3.png
Views:	60
Size:	33.7 KB
ID:	249852



    Anyway, I can address this on my end, but ideally, I don't think I should have to manipulate my data in order to get it to display consistently for different values of readOnlyDisplay.

    Thanks.

    #2
    See docs - escapeHTML property settable at multiple levels.

    Comment


      #3
      Thanks, I didn't see that option. However, escapeHTML is only listed as an attribute at the level of a couple of item types (e.g., StaticTextItem) at not at the FormItem or DynamicForm level which is where I'd need it to be. Adding escapeHTML: true to the 2nd item in the example above does not make the value appear.

      Comment


        #4
        Be sure to use search in the docs: escapeHTML is generally set on a DataSourceField, since it would apply to editing in multiple circumstances.

        We'll check on why it wouldn't be available at the TextItem level for a standalone form, but you can make your form fields into a DataSource definition and the test case becomes barely longer, and you now have a DataSource that can be used with multiple components.

        Comment


          #5
          Note: you could also just change your second TextItem to a StaticTextItem since you have effectively configured it to do the same thing.

          Comment


            #6
            We've made a change to resolve your original issue back to SC 10.1p/SGWT 5.1p. It should be in the nightly builds dated 2017-10-31 and beyond.

            Comment

            Working...
            X