ICEfaces
  1. ICEfaces
  2. ICE-9981

allow usage of html markup in mobi:dataViewColumn similar to h:outputText escape="false"

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.3.0.GA_P01
    • Fix Version/s: 4.1, EE-3.3.0.GA_P04
    • Component/s: MOBI-Components
    • Labels:
      None
    • Environment:
      jsf icemobile

      Description

      User is trying to display the value in the value attribute of the dataViewColumn itself - not in the dataViewDetails. For example:

                  <mobi:dataViewColumn headerText="testEscString " value="#{testBean.testEscString}"
                                         reactivePriority="0"/>

      This is acting just like h:outputText escape="false" so the question is the same - how to display user-entered text (whatever that is) AND line breaks.

        Activity

        Hide
        Judy Guglielmin added a comment -

        Can use the following:-
        tringEscapeUtils.escapeHtml(). Looks like it works for both h:outputText with escape="false" AND the mobi:dataViewColumn value attribute.

        bodyForView = StringUtils.replace(StringEscapeUtils.escapeHtml(body), "\n", "<br>");

        Show
        Judy Guglielmin added a comment - Can use the following:- tringEscapeUtils.escapeHtml(). Looks like it works for both h:outputText with escape="false" AND the mobi:dataViewColumn value attribute. bodyForView = StringUtils.replace(StringEscapeUtils.escapeHtml(body), "\n", "<br>");
        Hide
        Arturo Zambrano added a comment -

        r45043: added 'escape' attribute to mobi:dataViewColumn.

        There are still a few points that need to be decided/modified:
        1) Before this fix, it was already possible to include HTML tags in the column value by default, they were rendered "as is", meaning that all HTML tags were just passed through and became part of the markup, instead of treating them as text (as if to show some markup examples, etc.). So, the new escape attribute is 'false' by default, in order to preserve the old behaviour. However, in h:outputText, the default is 'true'.
        2) Because mobi:dataViewColumn uses a model object (interface), it was necessary to add to it a method corresponding to the escape attribute. This means that applications currently using a custom DataViewColumnsModel will need to be modified to include this method. An option would be to turn the interface into an abstract class with this new method (isEscape()) defined by default.

        Show
        Arturo Zambrano added a comment - r45043: added 'escape' attribute to mobi:dataViewColumn. There are still a few points that need to be decided/modified: 1) Before this fix, it was already possible to include HTML tags in the column value by default, they were rendered "as is", meaning that all HTML tags were just passed through and became part of the markup, instead of treating them as text (as if to show some markup examples, etc.). So, the new escape attribute is 'false' by default, in order to preserve the old behaviour. However, in h:outputText, the default is 'true'. 2) Because mobi:dataViewColumn uses a model object (interface), it was necessary to add to it a method corresponding to the escape attribute. This means that applications currently using a custom DataViewColumnsModel will need to be modified to include this method. An option would be to turn the interface into an abstract class with this new method (isEscape()) defined by default.
        Hide
        Arturo Zambrano added a comment -

        This is actually meant for the value itself, not for the header and footer text. Although, we'll double check if the customer wants that as well.

        Show
        Arturo Zambrano added a comment - This is actually meant for the value itself, not for the header and footer text. Although, we'll double check if the customer wants that as well.
        Hide
        Ken Fyten added a comment -

        Re-open for 3.3 maintenance backport.

        Show
        Ken Fyten added a comment - Re-open for 3.3 maintenance backport.
        Hide
        Ken Fyten added a comment -

        Let's make the default for 4.1 to be true, so it's aligned with the other JSF components.

        Show
        Ken Fyten added a comment - Let's make the default for 4.1 to be true, so it's aligned with the other JSF components.
        Hide
        Arturo Zambrano added a comment -

        r45085: committed improvement to the icemobile project.

        Show
        Arturo Zambrano added a comment - r45085: committed improvement to the icemobile project.
        Hide
        Arturo Zambrano added a comment -

        r45086: changed default value of 'escape' attribute to true (in 4.1).

        Show
        Arturo Zambrano added a comment - r45086: changed default value of 'escape' attribute to true (in 4.1).
        Hide
        Carmen Cristurean added a comment -

        Verified on ICEfaces 4.1 trunk revision 45088 in IE11, Chrome43, FF34 using the mobi:dataView/mobi:dataViewColumn QA test application.

        Show
        Carmen Cristurean added a comment - Verified on ICEfaces 4.1 trunk revision 45088 in IE11, Chrome43, FF34 using the mobi:dataView/mobi:dataViewColumn QA test application.

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Judy Guglielmin
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: