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

        Judy Guglielmin created issue -
        Judy Guglielmin made changes -
        Field Original Value New Value
        Assignee Steve Maryka [ steve.maryka ] Ken Fyten [ ken.fyten ]
        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>");
        Judy Guglielmin made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Won't Fix [ 2 ]
        Judy Guglielmin made changes -
        Resolution Won't Fix [ 2 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Ken Fyten made changes -
        Issue Type New Feature [ 2 ] Improvement [ 4 ]
        Ken Fyten made changes -
        Project ICEmobile [ 10060 ] ICEfaces [ 10021 ]
        Key MOBI-1053 ICE-9981
        Affects Version/s 1.3 Final [ 10873 ]
        Affects Version/s 1.3 EE [ 10973 ]
        Component/s MOBI-Components [ 10270 ]
        Component/s Faces [ 10062 ]
        Ken Fyten made changes -
        Summary allow usage of html markup in dataViewColumn similar to h:outputText escape="false" allow usage of html markup in mobi:dataViewColumn similar to h:outputText escape="false"
        Ken Fyten made changes -
        Assignee Ken Fyten [ ken.fyten ] Arturo Zambrano [ artzambrano ]
        Fix Version/s 4.0 [ 11382 ]
        Assignee Priority P3 [ 10012 ]
        Ken Fyten made changes -
        Assignee Priority P3 [ 10012 ] P1 [ 10010 ]
        Ken Fyten made changes -
        Assignee Priority P1 [ 10010 ] P3 [ 10012 ]
        Ken Fyten made changes -
        Fix Version/s EE-4.0.0.GA [ 11171 ]
        Fix Version/s 4.0 [ 11382 ]
        Ken Fyten made changes -
        Fix Version/s 4.1 [ 11375 ]
        Fix Version/s EE-4.0.0.GA [ 11171 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #45043 Tue Jun 16 14:40:28 MDT 2015 art.zambrano ICE-9981 added 'escape' attribute to mobi:dataViewColumn
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/component/dataview/DataViewColumn.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/component/dataview/DataViewColumnMeta.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/component/dataview/DataViewRenderer.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/model/dataview/DataViewColumnModel.java
        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.
        Arturo Zambrano made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        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.
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Ken Fyten made changes -
        Fix Version/s EE-3.3.0.GA_P04 [ 12270 ]
        Affects Version/s EE-3.3.0.GA_P01 [ 11174 ]
        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.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #45085 Mon Jun 22 19:42:50 MDT 2015 art.zambrano ICE-9981 added 'escape' attribute to mobi:dataViewColumn
        Files Changed
        Commit graph MODIFY /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/dataview/DataViewColumn.java
        Commit graph MODIFY /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/dataview/DataViewColumnMeta.java
        Commit graph MODIFY /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/dataview/DataViewRenderer.java
        Commit graph MODIFY /icemobile/trunk/icemobile/core/src/main/java/org/icemobile/model/DataViewColumnModel.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #45086 Mon Jun 22 19:45:49 MDT 2015 art.zambrano ICE-9981 changed default value of 'escape' attribute to true
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/component/dataview/DataViewColumnMeta.java
        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).
        Arturo Zambrano made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 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.
        Ken Fyten made changes -
        Affects Documentation (User Guide, Ref. Guide, etc.),Compatibility/Configuration [ 10003, 10002 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: