header datatable from .properties with <p:dataexporter

UI Components for JSF
Post Reply
jsfsaidi
Posts: 2
Joined: 07 Sep 2010, 12:41

07 Sep 2010, 14:51

hello every body
i read the topic about changing <f:loadbundle to <ressource-bundle> for <p:dataexporter to be working with the header writed with messages.propreties
and i change the faces-config.xml but when i click the exporting button i have this message

Code: Select all

7 sept. 2010 13:37:49 com.sun.faces.lifecycle.InvokeApplicationPhase execute
ATTENTION: Argument Error: Parameter targetClass is null
java.lang.NullPointerException: Argument Error: Parameter targetClass is null
	at com.sun.faces.application.ApplicationImpl.createConverter(ApplicationImpl.java:702)
	at org.primefaces.ui.util.ComponentUtils.getStringValueToRender(ComponentUtils.java:90)
	at org.primefaces.ui.component.export.ExcelExporter.addColumnValue(ExcelExporter.java:84)
	at org.primefaces.ui.component.export.ExcelExporter.addColumnHeaders(ExcelExporter.java:78)
	at org.primefaces.ui.component.export.ExcelExporter.export(ExcelExporter.java:48)
	at org.primefaces.ui.component.export.DataExporter.processAction(DataExporter.java:74)
	at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
	at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:743)
	at javax.faces.component.UICommand.broadcast(UICommand.java:368)
	at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
	at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
code of exporting is this

Code: Select all

<h:commandLink id="hlinkExport">
			<p:dataExporter type="xls" target="dataTable" fileName="listeStructure" excludeColumns="4"/>
		</h:commandLink>

and the datatable is this

Code: Select all

<rich:dataTable style="width : 98% ; align : center"
			binding="#{structureBean.dataTable}" id="dataTable">
			<f:facet name="header">
				<h:outputLabel value="#{i18n.structure_resultat}"></h:outputLabel>
			</f:facet>
			<rich:column id="colcode" sortBy="#{item.codearbo}">
				<f:facet name="header">
					<h:outputLabel value="#{i18n.structure_codeArbo}"></h:outputLabel>
				</f:facet>
				<h:outputText value="#{item.codearbo}" />
			</rich:column>
at the faces-config.xml i modified like this

Code: Select all

<application>
 <message-bundle>ApplicationMessages</message-bundle>
  <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
  <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
  <resource-bundle>
            <base-name>ApplicationMessages</base-name>
            <var>i18n</var>
  </resource-bundle>
  <locale-config>
   <default-locale>fr_FR</default-locale>
   <supported-locale>fr_FR</supported-locale>
   <supported-locale>en_EN</supported-locale>
  </locale-config>
 </application>
thank's for help

jsfsaidi
Posts: 2
Joined: 07 Sep 2010, 12:41

07 Sep 2010, 15:48

the solution is to download the latest jar primefaces-1.0.0.RC.jar

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

07 Sep 2010, 15:53

primefaces-1.0.0.RC.jar is not latest for sure.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests