Primefaces dataTable rowSelectCheckbox,rowUnSelectbox and toggleSelect events - jsf

I have datatable with checkbox selection option and I want to track check,uncheck and toggle select events. My code is :
<p:dataTable id="faDetail" value="#{assetSWOMB.faDetailList}"
lazy="true" rowIndexVar="rowsn" var="fad" rowKey="fad.id"
selection="#{assetSWOMB.selectedList}" scrollable="true"
scrollHeight="115">
<p:ajax event="rowSelectCheckbox" ajax="true"
immediate="true" listener="#{assetSWOMB.onCheck()}"
update=":mainForm:countUser" process="#this" />
<p:ajax event="rowUnselectCheckbox" ajax="true"
immediate="true" listener="#{assetSWOMB.onCheck()}"
update=":mainForm:countUser" process="#this" />
<f:facet name="header">
Asset Detail List
</f:facet>
<p:column style="width:16px;text-align:center"
selectionMode="multiple" />
<p:column headerText="#">
<h:outputText value="#{rowsn+1}" />
</p:column>
<p:column headerText="Given Name">
<h:outputText value="#{fad.assetGivenName}" />
</p:column>
<p:column headerText="Brand Name">
<h:outputText value="#{fad.brandDescription}" />
</p:column>
</p:dataTable>
Function in Managed Bean is :
public void onCheck(){
userCount = selectedList.size();
}
While selecting a checkbox (check or uncheck), it always displays following error :
com.sun.faces.context.PartialViewContextImpl processPartial
INFO: javax.faces.FacesException: DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled or you need to define rowKey attribute
javax.faces.FacesException: DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled or you need to define rowKey attribute
at org.primefaces.component.datatable.DataTable.getRowData(DataTable.java:950)
at org.primefaces.component.datatable.feature.SelectionFeature.decodeMultipleSelection(SelectionFeature.java:71)
at org.primefaces.component.datatable.feature.SelectionFeature.decode(SelectionFeature.java:40)
at org.primefaces.component.datatable.DataTableRenderer.decode(DataTableRenderer.java:57)
at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:787)
at org.primefaces.component.api.UIData.processDecodes(UIData.java:228)
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:506)
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
at org.primefaces.component.api.UIData.visitTree(UIData.java:639)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIForm.visitTree(UIForm.java:344)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:376)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:252)
at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:931)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.magnus.filter.LoginCheckFilter.doFilter(LoginCheckFilter.java:129)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
But I have defined rowKey.
How to make it work ??

Try with this rowKey="#{fad.id}"

Related

java.lang.ClassCastException: org.primefaces.component.column.Column cannot be cast to org.primefaces.component.row.Row

I am trying to make a data search on a table. I have tried to follow the example in the showcase primefaces for the DataTable filter. However, strangely when I enter the value that I want to find, the contents of the table will immediately empty. For example I want to find the username 'A', then when I type 'A' the contents of the table will disappear.
Here is my table:
<h:form id="dataTable">
<p:dataTable var="users" rows="10" value="#{listUserAccountBean.users}"
style="width: 100%; float: left; margin-top:10px;" paginator="true"
pageLinks="10" rowsPerPageTemplate="5,10,15"
widgetVar="widgetWorkOrder" rowIndexVar="rowIndex"
paginatorPosition="bottom" emptyMessage="No record found"
styleClass="no-dtbl-header" id="listDataUser" filteredValue="#{listUserAccountBean.filteredUsers}"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
<f:facet name="header">
<p:outputPanel>
<h:outputText value="Search all fields:" />
<p:inputText id="globalFilter" onkeyup="PF('widgetWorkOrder').filter()" placeholder="Enter keyword"/>
</p:outputPanel>
</f:facet>
<p:columnGroup type="header">
<p:column headerText="Username" />
<p:column headerText="Password" />
<p:column headerText="Action" colspan="2"/>
</p:columnGroup>
<p:column filterBy="#{users.username}" footerText="test1" filterMatchMode="test1">
<h:outputText value="#{users.username}" />
</p:column>
<p:column filterBy="#{users.password}" footerText="test2" filterMatchMode="test2">
<h:outputText value="#{users.password}" />
</p:column>
<p:column style="text-align: center">
<p:commandLink action="#{listUserAccountBean.goToEditUserAccount(users)}">
<p:graphicImage name="edit.png" library="images" width="25px"
height="25px" />
</p:commandLink>
</p:column>
<p:column style="text-align: center">
<p:commandLink actionListener="#{listUserAccountBean.prepareDelete(users)}"
oncomplete="PF('dlg-delete').show();">
<p:graphicImage name="delete-admin.png" library="images"
width="25px" height="25px" />
</p:commandLink>
</p:column>
</p:dataTable>
</h:form>
Here is my log cat:
14:37:38,073 INFO [javax.enterprise.resource.webcontainer.jsf.context] (http-localhost-127.0.0.1-8081-2) java.lang.ClassCastException: org.primefaces.component.column.Column cannot be cast to org.primefaces.component.row.Row: java.lang.ClassCastException: org.primefaces.component.column.Column cannot be cast to org.primefaces.component.row.Row
at org.primefaces.component.datatable.feature.FilterFeature.populateFilterMetaDataInColumnGroup(FilterFeature.java:283) [primefaces-5.3.jar:5.3]
at org.primefaces.component.datatable.feature.FilterFeature.populateFilterMetaData(FilterFeature.java:257) [primefaces-5.3.jar:5.3]
at org.primefaces.component.datatable.feature.FilterFeature.decode(FilterFeature.java:90) [primefaces-5.3.jar:5.3]
at org.primefaces.component.datatable.DataTable.processValidators(DataTable.java:716) [primefaces-5.3.jar:5.3]
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:508) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183) [jsf-impl-2.1.7-jbossorg-2.jar:]
at org.primefaces.component.api.UIData.visitTree(UIData.java:822) [primefaces-5.3.jar:5.3]
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIForm.visitTree(UIForm.java:371) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:376) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:252) [jsf-impl-2.1.7-jbossorg-2.jar:]
at org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:60) [primefaces-5.3.jar:5.3]
at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1170) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.7-jbossorg-2.jar:]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:67) [log4j-web-2.0.2.jar:2.0.2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
14:37:38,020 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http-localhost-127.0.0.1-8081-2) java.lang.NullPointerException
Did I miss something?
Add a p:row as child of p:columnGroup wrapping your p:column.
<p:columnGroup type="header">
<p:row>
<p:column headerText="Username" />
<p:column headerText="Password" />
<p:column headerText="Action" colspan="2"/>
</p:row>
</p:columnGroup>
It seems PrimeFaces code searches the first child of columnGroup and tries to cast it to column.

javax.el.MethodNotFoundException: Method not found: tes.sales.bean.DocumentosBean#1821df11.onTestEvent(org.primefaces.event.SelectEvent)

I have problems with the selection checkbox in datatable, I add a ajax with "rowSelectCheckbox" event and to select a checkbox suge the following error:
WARNING: Method not found:
tes.sales.bean.DocumentosBean#1821df11.onTestEvent(org.primefaces.event.SelectEvent)
javax.el.MethodNotFoundException: Method not found:
tes.sales.bean.DocumentosBean#1821df11.onTestEvent(org.primefaces.event.SelectEvent)
at
org.apache.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:245)
at org.apache.el.parser.AstValue.invoke(AstValue.java:271) at
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
at
org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processCustomListener(AjaxBehaviorListenerImpl.java:87)
at
org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processArgListener(AjaxBehaviorListenerImpl.java:72)
at
org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxBehaviorListenerImpl.java:56)
at
org.primefaces.event.SelectEvent.processListener(SelectEvent.java:40)
at
javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:106)
at
javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:804)
at javax.faces.component.UIData.broadcast(UIData.java:1086) at
javax.faces.component.UIData.broadcast(UIData.java:1108) at
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:72)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
jul 06, 2015 5:05:21 PM com.sun.faces.context.AjaxExceptionHandlerImpl
handlePartialResponseError SEVERE: javax.el.MethodNotFoundException:
Method not found:
tes.sales.bean.DocumentosBean#1821df11.onTestEvent(org.primefaces.event.SelectEvent)
at
org.apache.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:245)
at org.apache.el.parser.AstValue.invoke(AstValue.java:271) at
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
at
org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processCustomListener(AjaxBehaviorListenerImpl.java:87)
at
org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processArgListener(AjaxBehaviorListenerImpl.java:72)
at
org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxBehaviorListenerImpl.java:56)
at
org.primefaces.event.SelectEvent.processListener(SelectEvent.java:40)
at
javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:106)
at
javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:804)
at javax.faces.component.UIData.broadcast(UIData.java:1086) at
javax.faces.component.UIData.broadcast(UIData.java:1108) at
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:72)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
xhtml
<h:form>
<p:dataTable id="myTable" var="mydoc" value="#{DocumentosBean.documentos}" rows="20" paginator="true" sortOrder="descending"
selection="#{DocumentosBean.selectedDocs}" filteredValue="#{DocumentosBean.myFilter}"
sortBy="#{mydoc.id}" rowKey="#{mydoc.id}" rowIndexVar="indexRow">
<p:ajax event="rowSelectCheckbox" listener="#{DocumentosBean.onTestEvent}" />
<p:ajax event="rowUnselectCheckbox" process="#this"/>
<p:ajax event="toggleSelect" process="#this"/>
<p:column selectionMode="multiple" style="min-width:20px;text-align:center;"></p:column>
<p:column headerText="Id">
<h:outputText value="#{mydoc.id}" />
</p:column>
<p:column headerText="Vendedor">
<h:outputText value="#{mydoc.vendedor}" />
</p:column>
<p:column headerText="Moneda">
<h:outputText value="#{mydoc.moneda}" />
</p:column>
<p:column headerText="Operación">
<h:outputText value="#{mydoc.operacion}" />
</p:column>
<p:column headerText="Fecha Creación">
<h:outputText value="#{mydoc.fechaCreacion}" />
</p:column>
<p:column headerText="Estado">
<h:outputText value="#{mydoc.estado}" />
</p:column>
</p:dataTable>
</h:form>
Bean
#ManagedBean(name="DocumentosBean")
#SessionScoped
public class DocumentosBean implements Serializable {
private static final long serialVersionUID = 1L;
private List<ListaDocumentos> documentos;
private ListaDocumentos selectedDoc;
private ListaDocumentos[] selectedDocs;
private List<ListaDocumentos> myFilter;
public DocumentosBean() {
System.out.println("SelectEvent");
documentos = new ArrayList<ListaDocumentos>();
fillData(documentos);
/*myFilter = new ArrayList<ListaDocumentos>();
fillData(myFilter);*/
}
public void onTestEvent(SelectEvent e){
System.out.println(".......");
System.out.println(e.getObject().toString());
}
}

Primefaces5 Wizard component & JSF2.2.7 File Upload not Working?

I am using PF5.0 and JSF2.2.7 in my web application using primefaces Wizard Component for file uploading like this
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
template="./../templates/loggedinTemplate.xhtml">
<ui:define name="title">Group Distribution </ui:define>
<ui:define name="moduleDetails">
<h:form enctype="application/x-www-form-urlencoded; charset=UTF-8" >
<p:growl id="growl" sticky="true" showDetail="true" />
<p:overlayPanel for="helpButton" hideEffect="fade"
style="float: right; width: 50%">
<p:panel header="3 Step Process" style="width:97%;">
<p:spacer height="40"></p:spacer>
<h:outputText value="Step 1" styleClass="linkButton"
style="background-color: #0165b0 !important" />
<h:outputText style="font-size:12px;" value=" Upload XSL File" />
<br />
<p:spacer height="40"></p:spacer>
<h:outputText value="Step 2" styleClass="linkButton"
style="background-color: #0165b0 !important" />
<h:outputText style="font-size:12px;"
value="Check Length and make changes" />
<br />
<p:spacer height="40"></p:spacer>
<h:outputText value="Step 3" styleClass="linkButton"
style="background-color: #0165b0 !important" />
<h:outputText style="font-size:12px;" value="Save Tweets" />
</p:panel>
</p:overlayPanel>
<f:facet name="actions">
<p:commandLink value="Help" id="helpButton" type="button"
styleClass="ui-panel-titlebar-icon" />
</f:facet>
<p:spacer height="20"></p:spacer>
<p:wizard widgetVar="fileUploadWiz" nextLabel="Next"
flowListener="#{tweetDistributionManagedBean.onFlowProcess}"
showStepStatus="true">>
<p:tab id="upload" title="Upload File" styleClass="main">
<p:panel style="width:100%" styleClass="panelnoborder">
<f:facet name="header">
<p:outputLabel styleClass="mainTitlebar"
value="Step 1. Upload XSL File"></p:outputLabel>
</f:facet>
<p:spacer height="10" width="100%"></p:spacer>
<h:outputText
value="If transactions are in an Excel spreadsheet, then first save the sheet as CSV file and then upload. Download " />
<p:commandLink id="downloadLink" value="Sample Xls File"
ajax="false" style="font-size:12px;color:#F62217 !important">
<p:fileDownload
value="#{tweetDistributionManagedBean.downloadFile}" />
</p:commandLink>
<p:spacer height="20" width="100%"></p:spacer>
<p:panelGrid align="centre" style="width:100%" cellspacing="5">
<p:row>
<p:column>
<p:fileUpload
style="font-size:12px;background-color: #FC8C02 !important;align:centre;"
fileUploadListener="#{tweetDistributionManagedBean.handleFileUpload}"
label="Choose File" showButtons="false"
requiredMessage="Please select the file" required="true"
mode="advanced" multiple="true" update="#form" auto="true"
sizeLimit="1048576"
allowTypes="/(\.|\/)(doc|docx|xls|xlsx|pdf)$/" />
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputText
value="#{tweetDistributionManagedBean.fileUploadMessage}"></h:outputText>
</p:column>
</p:row>
</p:panelGrid>
</p:panel>
</p:tab>
<p:tab title="Edit Tweets" styleClass="main">
<p:panel>
<f:facet name="header">
<p:outputLabel styleClass="mainTitlebar"
value="Step 2. Edit Tweets"></p:outputLabel>
</f:facet>
<h:panelGrid columns="1" cellpadding="10" cellspacing="5"
style="width:700px;" columnClasses="label, value">
<p:column>
<p:dataTable
value="#{tweetDistributionManagedBean.excellist}" var="o"
resizableColumns="true" styleClass="ui-datatable-hor-scroll"
scrollWidth="100%" tableStyle="width:auto" rowKey="#{o}">
<p:column headerText="Tweet Id">
<h:outputText value="#{o.distObject.gdId}" />
</p:column>
<p:column headerText="Tweet">
<h:inputText value="#{o.distObject.gdTweet}" size="20" />
</p:column>
</p:dataTable>
</p:column>
<p:spacer></p:spacer>
<p:commandButton value="Submit"
actionListener="#{groupWizardBean.saveGroup}" update="growl" />
</h:panelGrid>
</p:panel>
</p:tab>
</p:wizard>
</h:form>
</ui:define>
</ui:composition>
But after uploading file when i am clicking on Next button it is throwing
INFO: javax.faces.FacesException: javax.servlet.ServletException:
org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException:
the request doesn't contain a multipart/form-data or multipart/mixed
stream, content type header is application/x-www-form-urlencoded;
charset=UTF-8 javax.faces.FacesException:
javax.servlet.ServletException:
org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException:
the request doesn't contain a multipart/form-data or multipart/mixed
stream, content type header is application/x-www-form-urlencoded;
charset=UTF-8 at
org.primefaces.component.fileupload.NativeFileUploadDecoder.decode(NativeFileUploadDecoder.java:44)
at
org.primefaces.component.fileupload.FileUploadRenderer.decode(FileUploadRenderer.java:44)
at
javax.faces.component.UIComponentBase.decode(UIComponentBase.java:831)
at javax.faces.component.UIInput.decode(UIInput.java:771) at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1225)
at javax.faces.component.UIInput.processDecodes(UIInput.java:676) at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1220)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1220)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1220)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1220)
at
org.primefaces.component.panel.Panel.processDecodes(Panel.java:280)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1220)
at
org.primefaces.component.wizard.Wizard.processDecodes(Wizard.java:179)
at
com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:573)
at
com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1689)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
at javax.faces.component.UIForm.visitTree(UIForm.java:371) at
javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) at
javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) at
com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:403)
at
com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:266)
at
javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:219)
at
org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:60)
at
javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:927)
at
com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:70)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722) Caused by:
javax.servlet.ServletException:
org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException:
the request doesn't contain a multipart/form-data or multipart/mixed
stream, content type header is application/x-www-form-urlencoded;
charset=UTF-8 at
org.apache.catalina.connector.Request.parseParts(Request.java:2772)
at org.apache.catalina.connector.Request.getParts(Request.java:2631)
at org.apache.catalina.connector.Request.getPart(Request.java:2796)
at
org.apache.catalina.connector.RequestFacade.getPart(RequestFacade.java:1082)
at
org.primefaces.component.fileupload.NativeFileUploadDecoder.decodeAdvanced(NativeFileUploadDecoder.java:60)
at
org.primefaces.component.fileupload.NativeFileUploadDecoder.decode(NativeFileUploadDecoder.java:37)
... 53 more Caused by:
org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException:
the request doesn't contain a multipart/form-data or multipart/mixed
stream, content type header is application/x-www-form-urlencoded;
charset=UTF-8 at
org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:774)
at
org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:284)
at
org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:304)
at
org.apache.tomcat.util.http.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:129)
at
org.apache.catalina.connector.Request.parseParts(Request.java:2713)
... 58 more
Aug 05, 2014 1:48:27 PM
com.sun.faces.lifecycle.ApplyRequestValuesPhase execute WARNING:
javax.faces.FacesException: javax.servlet.ServletException:
org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException:
the request doesn't contain a multipart/form-data or multipart/mixed
stream, content type header is application/x-www-form-urlencoded;
charset=UTF-8 javax.faces.FacesException: javax.faces.FacesException:
javax.servlet.ServletException:
org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException:
the request doesn't contain a multipart/form-data or multipart/mixed
stream, content type header is application/x-www-form-urlencoded;
charset=UTF-8 at
com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:273)
at
javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:219)
at
org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:60)
at
javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:927)
at
com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:70)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722) Caused by:
javax.faces.FacesException: javax.servlet.ServletException:
org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException:
the request doesn't contain a multipart/form-data or multipart/mixed
stream, content type header is application/x-www-form-urlencoded;
charset=UTF-8 at
org.primefaces.component.fileupload.NativeFileUploadDecoder.decode(NativeFileUploadDecoder.java:44)
at
org.primefaces.component.fileupload.FileUploadRenderer.decode(FileUploadRenderer.java:44)
at
javax.faces.component.UIComponentBase.decode(UIComponentBase.java:831)
at javax.faces.component.UIInput.decode(UIInput.java:771) at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1225)
at javax.faces.component.UIInput.processDecodes(UIInput.java:676) at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1220)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1220)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1220)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1220)
at
org.primefaces.component.panel.Panel.processDecodes(Panel.java:280)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1220)
at
org.primefaces.component.wizard.Wizard.processDecodes(Wizard.java:179)
at
com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:573)
at
com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1689)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
at javax.faces.component.UIForm.visitTree(UIForm.java:371) at
javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) at
javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) at
com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:403)
at
com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:266)
... 32 more Caused by: javax.servlet.ServletException:
org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException:
the request doesn't contain a multipart/form-data or multipart/mixed
stream, content type header is application/x-www-form-urlencoded;
charset=UTF-8 at
org.apache.catalina.connector.Request.parseParts(Request.java:2772)
at org.apache.catalina.connector.Request.getParts(Request.java:2631)
at org.apache.catalina.connector.Request.getPart(Request.java:2796)
at
org.apache.catalina.connector.RequestFacade.getPart(RequestFacade.java:1082)
at
org.primefaces.component.fileupload.NativeFileUploadDecoder.decodeAdvanced(NativeFileUploadDecoder.java:60)
at
Can any one tell me what changes and configuration i am missing ?

p:ajax throwing method not found exception with p:selectOneRadio

I am trying to Ajax event with p:selectOneRadio> and I'm getting
WARNING: Method not found: com.ccc.managedController.TweetDistributionManagedBean#78159a62.renderUploadPanel(javax.faces.event.AjaxBehaviorEvent)
javax.el.MethodNotFoundException: Method not found: com.ccc.managedController.TweetDistributionManagedBean#78159a62.renderUploadPanel(javax.faces.event.AjaxBehaviorEvent)
at org.apache.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:245)
at org.apache.el.parser.AstValue.invoke(AstValue.java:271)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processCustomListener(AjaxBehaviorListenerImpl.java:87)
at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processArgListener(AjaxBehaviorListenerImpl.java:72)
at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxBehaviorListenerImpl.java:56)
at javax.faces.event.AjaxBehaviorEvent.processListener(AjaxBehaviorEvent.java:113)
at javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:106)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:760)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:98)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Here are more code
<h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
<p:outputLabel for="selectone" value="Upload :" />
<p:selectOneRadio id="selectone"
value="#{tweetDistributionManagedBean.tweetType}">
<f:selectItem itemLabel="Group Tweets" itemValue="GT" />
<f:selectItem itemLabel="Event Tweets" itemValue="ET" />
<f:selectItem itemLabel="Suprachar Tweets" itemValue="ST" />
<p:ajax event="click"
listener="#{tweetDistributionManagedBean.renderUploadPanel}"
update="gtid" process="#form" global="false" />
</p:selectOneRadio>
</h:panelGrid>
and Java bean method
public void renderUploadPanel(final SelectEvent event) {
String selecteValues = (String) event.getObject();
visibleGTFlag = true;
}
Moist likely the 'SelectEvent' is not an event that extends AjaxBehaviourEvent . This can happen if you import the wrong class type. Try this
public void renderUploadPanel(AjaxBehaviorEvent event) {
System.out.println(tweetType);
visibleGTFlag = true;
}
You can try to use the event "ValueChangeEvent", look my example:
public void renderUploadPanel(ValueChangeEvent event) {
String selecteValues = event.getNewValue().toString();
visibleGTFlag = true;
}

tabview inside another tabview

i 'am trying to put a tabview inside a another tabview but i get error in the ajax event from the tabview inside here is the error
javax.el.MethodNotFoundException: Method not found: com.controlleurs.SelectBean#75c0452.onTabChange1(javax.faces.event.AjaxBehaviorEvent)
at org.apache.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:249)
at org.apache.el.parser.AstValue.invoke(AstValue.java:271)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:273)
at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processCustomListener(AjaxBehaviorListenerImpl.java:87)
at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processArgListener(AjaxBehaviorListenerImpl.java:72)
at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxBehaviorListenerImpl.java:56)
at javax.faces.event.AjaxBehaviorEvent.processListener(AjaxBehaviorEvent.java:113)
at javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:106)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:804)
at javax.faces.component.UIData.broadcast(UIData.java:1086)
at javax.faces.component.UIData.broadcast(UIData.java:1108)
at javax.faces.component.UIData.broadcast(UIData.java:1108)
at javax.faces.component.UIData.broadcast(UIData.java:1108)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
here is my xhmtl code
<h:form id="form">
<p:tabView id="my" >
<p:tab id="tabview" title="Ressources Humaines">
<p:tabView activeIndex="#{SelectBean.activeTab}" value="#{SelectBean.types}" var="item" >
<p:ajax event="tabChange" listener="#{SelectBean.onTabChange}" update=":form" />
<p:tab title="#{item}">
<p:tabView id="tab" activeIndex="#{SelectBean.other}" value="#{SelectBean.res}" var="rr">
<p:ajax event="tabChange" listener="#{SelectBean.onTabChange1}" />
<p:tab title="#{rr.nom_ressource}">
<h:panelGrid>
<h:graphicImage value="Ressources/images/emp.jpg" style="vertical-align:middle" />
<span style="font-size:15px; width:170px; display:inline-block;"> Nom : #{rr.nom_ressource} Type: #{rr.type_ressource} Specification: #{rr.experience} </span>
<h:commandButton image="Ressources/images/delete.jpg" actionListener="#{SelectBean.act}" update=":form" style="vertical-align:middle" >
Supprimer
</h:commandButton>
<h:commandButton image="Ressources/images/update.png" style="vertical-align:middle" >
Modifier
</h:commandButton>
</h:panelGrid>
</p:tab>
</p:tabView>
</p:tab>
</p:tabView>
</p:tab>
<p:tab title="Ressources Materielle">
</p:tab>
</p:tabView>
</h:form>
anyhelp please
In your bean he cant find the method..
The signature of the method should be public void onTabChange(TabChangeEvent event)
This is how your method signature looks like?
Why you have double <p:ajax event="tabChange"
Hope that help

Resources