Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367192

Summary: Embedding a report in a JSF 2.0 facelet via Ajax.
Product: z_Archived Reporter: Livio Lazzeri <livio.lazzeri>
Component: BIRTAssignee: Birt-ReportEngine-inbox <Birt-ReportEngine-inbox>
Status: NEW --- QA Contact: Hao Zhou <hao.zhou>
Severity: normal    
Priority: P3 CC: bluesoldier, jouyang
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.