Displaying html in h:outputText in a p:scrollPanel

jQuery UI Widgets
Post Reply
simteq
Posts: 23
Joined: 02 Aug 2016, 11:59

17 Aug 2016, 15:49

Hi
I am using JSF 2.2.9 and Primefaces 6.
I am generating a report using BIRT which produces an HTML string which I want to display as text using h:outputText inside a scrollable panel ie. p:scrollPanel. After searching the net it suggests setting the excape attribute of h:outputText to false but all I get is the complete dialog being blank, if I set excape to true the dialog displays correctly but the h:outputText contains the HTML

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:u="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jstl/core" 
      xmlns:p="http://primefaces.org/ui">
 
     <u:composition>
	 <p:dialog  widgetVar="reportDialog" modal="false" closable="false" width="1000" height="700"  >
		 <h:panelGroup id="reportPanel">
		 	<p:spacer width="100%" height="10" />
		 	<p:panel rendered="#{reportBean.enableReport}" >
		 		<f:facet name="header" >
					<h:outputText value="Counterparty Report"  styleClass="default-header" />
				</f:facet>
						
				<p:scrollPanel  style="width:940px;height:580px;"  >					
				      <h:outputText value="#{reportBean.counterpartyReport}" escape="false" /> 		     			
				</p:scrollPanel>							
				<p:spacer width="100%" height="10" />
				<p:toolbar>
                                       <f:facet name="right">
						<p:commandButton value="Cancel" action="#{reportBean.cancelReport}" 
										 onclick="PF('reportDialog').hide();"
										 update="reportPanel"/>
					</f:facet>	        			
				</p:toolbar>					
			</p:panel>
		</h:panelGroup>
	</p:dialog>
</u:composition>
</html>

Post Reply

Return to “PrimeUI”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests