ICEfaces
  1. ICEfaces
  2. ICE-8512

ace:dataExporter, in-line EL expressions aren't evaluated but exported verbatim

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.2
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Tomcat 7, Chrome, Firefox, IE

      Description

      When an EL expression is in-line (i.e. not as the value of an output component), it is not evaluated when exported, but the expression itself is exported. For example, the following markup will export the characters '#{row.id}' in the generated file, for every row:

                          <ace:column headerText="col1">
                              #{row.id}
                          </ace:column>

      The following markup will export the value obtained after evaluating the expression (e.g. 'id001').

                          <ace:column headerText="col1">
                              <h:outputText value="#{row.id}" />
                          </ace:column>

      The ace:dataExporter component needs to support in-line EL expressions as well.
      1. Case11558.rar
        16 kB
        Evgheni Sadovoi
      2. dynamicData.csv
        1 kB
        Evgheni Sadovoi
      3. dynamicData.pdf
        2 kB
        Evgheni Sadovoi

        Activity

        Evgheni Sadovoi created issue -
        Evgheni Sadovoi made changes -
        Field Original Value New Value
        Attachment dynamicData.csv [ 14847 ]
        Attachment dynamicData.pdf [ 14848 ]
        Attachment Case11558.rar [ 14849 ]
        Ken Fyten made changes -
        Salesforce Case []
        Fix Version/s 3.2 [ 10338 ]
        Assignee Priority P2
        Assignee Arturo Zambrano [ artzambrano ]
        Evgheni Sadovoi made changes -
        Salesforce Case [5007000000NJO3T]
        Hide
        Arturo Zambrano added a comment - - edited

        There's nothing wrong with the table being dynamic. The problem is that the EL expression is not inside a component. The exporter needs to manually extract the value from each component inside the column, because it cannot just call encodeAll() on the column. Since, the expression is not inside a component, it gets treated as plain text. If it is placed as the value of an <h:outputText /> component, the table is exported correctly.

        Show
        Arturo Zambrano added a comment - - edited There's nothing wrong with the table being dynamic. The problem is that the EL expression is not inside a component. The exporter needs to manually extract the value from each component inside the column, because it cannot just call encodeAll() on the column. Since, the expression is not inside a component, it gets treated as plain text. If it is placed as the value of an <h:outputText /> component, the table is exported correctly.
        Arturo Zambrano made changes -
        Summary ace:dataExporter issue with dynamic ace:datatable ace:dataExporter, in-line EL expressions aren't evaluated but exported verbatim
        Description There is an issue with ace:dataExporter and dynamic ace:dataTable. When an attempt is made to use dataExporter the file is downloaded but contain EL expressions in table cells similar to the following

         #{row[colModel.value]} ... #{row[colModel.value]}.... #{row[colModel.value]}... #{row[colModel.value]}

        instead of the data from a table.

        To reproduce use the source code attached to this ticket. Sample outcome from the export action has been attached as well
        When an EL expression is in-line (i.e. not as the value of an output component), it is not evaluated when exported, but the expression itself is exported. For example, the following markup will export the characters '#{row.id}' in the generated file, for every row:

                            <ace:column headerText="col1">
                                #{row.id}
                            </ace:column>

        The following markup will export the value obtained after evaluating the expression (e.g. 'id001').

                            <ace:column headerText="col1">
                                <h:outputText value="#{row.id}" />
                            </ace:column>

        The ace:dataExporter component needs to support in-line EL expressions as well.
        Hide
        Arturo Zambrano added a comment -

        Modified the JIRA's title and description to better illustrate the actual issue.

        Show
        Arturo Zambrano added a comment - Modified the JIRA's title and description to better illustrate the actual issue.
        Hide
        Evgheni Sadovoi added a comment -

        This ticket should be considered for all types of exports which ace:dataExporter support.

        Show
        Evgheni Sadovoi added a comment - This ticket should be considered for all types of exports which ace:dataExporter support.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #30911 Tue Sep 18 12:02:59 MDT 2012 art.zambrano ICE-8512 added fix to evaluate in-line EL expressions when exporting
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/Exporter.java
        Hide
        Arturo Zambrano added a comment - - edited

        Committed fix to the trunk at revision 30911.

        Show
        Arturo Zambrano added a comment - - edited Committed fix to the trunk at revision 30911.
        Migration made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P2 [ 10011 ]

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Evgheni Sadovoi
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: