Hello everybody
I have the same problem. When i click on export (excel or pdf), i have the following error:
Code: Select all
exception
javax.servlet.ServletException: Cannot find component ":pdtUserSearch" in view.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:422)
root cause
javax.faces.FacesException: Cannot find component ":pdtUserSearch" in view.
org.primefaces.component.export.DataExporter.processAction(DataExporter.java:89)
javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
javax.faces.component.UICommand.broadcast(UICommand.java:300)
javax.faces.component.UIData.broadcast(UIData.java:1093)
org.primefaces.component.datatable.DataTable.broadcast(DataTable.java:630)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
Here's my xhtml code :
Code: Select all
<p:dataTable var="user" paginator="true" rows="2" paginatorPosition="bottom" lazy="true"
paginatorAlwaysVisible="false" value="#{loginManagedBean.lazyUserSearch}" id="pdtUserSearch"
paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
selectionMode="single" selection="#{loginManagedBean.selectedUser}">
<f:facet name="header">
<cc:align position="right">
#{msg.genExportLabel} :
<h:commandLink>
<h:graphicImage value="/resources/imgs/icons/page_white_acrobat.png" />
<p:dataExporter target=":pdtUserSearch" type="pdf" fileName="userSearch" />
</h:commandLink>
<p:spacer width="10" />
<h:commandLink>
<h:graphicImage value="/resources/imgs/icons/page_white_excel.png" />
<p:dataExporter target=":pdtUserSearch" type="xls" fileName="userSearch" />
</h:commandLink>
</cc:align>
</f:facet>
<p:column>
<f:facet name="header">
#{msg.usersMgmtLabelLogin}
</f:facet>
<p:commandLink>
#{user.login}
</p:commandLink>
</p:column>
<p:column>
<f:facet name="header">
#{msg.usersMgmtLabelEmail}
</f:facet>
#{user.email}
</p:column>
</p:dataTable>
When i look the source code i have this :
Code: Select all
<div id="j_idt33:j_idt84:pdtUserSearch" class="ui-datatable ui-widget">
Any idea about this problem ?
Thanks