Bug 367192 - Embedding a report in a JSF 2.0 facelet via Ajax.
Summary: Embedding a report in a JSF 2.0 facelet via Ajax.
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Birt-ReportEngine-inbox@eclipse.org CLA
QA Contact: Hao Zhou CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-20 09:37 EST by Livio Lazzeri CLA
Modified: 2012-01-03 22:06 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Livio Lazzeri CLA 2011-12-20 09:37:14 EST
Build Identifier: Eclipse M20110210-1200  (Engine 3.7.1)

A Birt report can be successfully embedded in a JSF 2.0 facelet via a tag
<h:outputText escape="false" value="#{...}">
whose value is the String resulting from an embeddable HTML Birt report.
This technique fails when the report is provided via ajax and it contains some javascript (such as, for example, a chart with interactivity).
The reason of failure is that JSF inserts the ajax response in a XML file, enclosed in a CDATA section.
If the report contains some javascript, Birt encloses it in a CDATA section.
The result is an XML file containing two nested CDATA sections, which is wrong.
It could be an issue of Mojarra, which should take care of eventual CDATA sections in the HTML fragment.
A circumvention is to transform the nested CDATA in two adiacent CDATA, with just one simple method call:
embeddableHtml = embeddableHtml.replace("]]>", "]]><![CDATA[]]]]><![CDATA[>");

Reproducible: Always
Comment 1 Jun Ouyang CLA 2011-12-29 21:23:23 EST
Need to provide a flag to avoid CDATA tag.