Announcement

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

    escaping HTML for text fields in ds.xml

    Hi,

    I want to escape HTML in a read-only screen with text fields. For example, a street field like this....
    Code:
    <field name="street" title="Street" type="text" canEdit="false" readOnlyDisplay="static" escapeHTML="true"/>
    The field displays as static text but does not escape HTML.

    I log the fields and see that the type is TextItem, but TextItem doesn't have the setEscapeHTML(boolean) method while StaticTextItem does have that method. Could that be the reason?

    The docs for FieldType doesn't include STATICTEXT, but I tried using type="statictext" anyway. It didn't work though.

    Is there a way to declare in the ds.xml that a text field should escape HTML?

    Thanks,
    -chris

    #2
    It looks like you are either dealing with an older build or older version. Update to the latest and remember to always post your full version in the future.

    Comment


      #3
      that was one of my expectations

      Comment


        #4
        sure enough, the street text field configured as above properly escapes HTML in version 6.1-20180103 (from POM file)

        Comment

        Working...
        X