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
Related
MyTabs.xhtml
<html 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">
<h:head>
<title>Tab view</title>
</h:head>
<h:form style="width:500px;" id="form">
<p:growl id="msgs" showDetail="true" />
<p:tabView dynamic="true">
<p:ajax event="tabChange" listener="#{MyTab.tabChange}" update="p1 p2 p3"/>
<p:tab title="C" id="c">
<h:panelGrid columns="2" cellpadding="10" id="p1">
<h:outputText value="#{MyTab.msg}"></h:outputText>
</h:panelGrid>
</p:tab>
<p:tab title="C++" id="cpp">
<h:panelGrid columns="2" cellpadding="10" id="p2">
<h:outputText value="#{MyTab.msg}"></h:outputText>
</h:panelGrid>
</p:tab>
<p:tab title="Java" id="java">
<h:panelGrid columns="2" cellpadding="10" id="p3">
<h:outputText value="#{MyTab.msg}"></h:outputText>
</h:panelGrid>
<p:tabView dynamic="false">
<f:ajax event="tabChange" listener="#{MyTab.tabChange2}" update="pg1,pg2"/>
<p:tab title="JSP" id="jsp">
<h:panelGrid id="pg1">
<h:outputText value="#{MyTab.javaProg}"></h:outputText>
</h:panelGrid>
</p:tab>
<p:tab title="JSF" id="jsf">
<h:panelGrid id="pg2">
<h:outputText value="#{MyTab.javaProg}"></h:outputText>
</h:panelGrid>
</p:tab>
</p:tabView>
</p:tab>
</p:tabView>
</h:form>
</html>
MyTab.java
package mypak;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import org.primefaces.event.TabChangeEvent;
#ManagedBean(name="MyTab")
public class MyTab {
private String msg="C";
private String javaProg="j2ee";
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getJavaProg() {
return javaProg;
}
public void tabChange(TabChangeEvent e){
String id=e.getTab().getId();
if(id.equals("c")){
msg="C is a good programming language.";
}else if(id.equals("cpp")){
msg="C++ is better !";
}else{
msg="Java is the best :)";
}
}
public void tabChange2(TabChangeEvent e){
System.out.println("nested");
String id=e.getTab().getId();
if(id.equals("jsp")){
javaProg="JSP is good option";
}
if(id.equals("jsf")){
javaProg="JSF is the better";
}
}
}
Error I am getting when I click on a nested tab
Sep 16, 2015 9:45:37 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute
WARNING: /MyTabs.xhtml #31,81 listener="#{MyTab.tabChange2}": java.lang.NullPointerException
javax.el.ELException: /MyTabs.xhtml #31,81 listener="#{MyTab.tabChange2}": java.lang.NullPointerException
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:111)
at com.sun.faces.facelets.tag.jsf.core.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxHandler.java:462)
at org.primefaces.event.TabChangeEvent.processListener(TabChangeEvent.java:42)
at javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:106)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:809)
at org.primefaces.component.api.UITabPanel.broadcast(UITabPanel.java:1259)
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:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at mypak.MyTab.tabChange2(MyTab.java:38)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.el.parser.AstValue.invoke(AstValue.java:247)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
... 32 more
I am using JSF 2,Prime Faces 5.2 ,Tomcat 8.
How is this caused and how can I solve it?
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}"
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 ?
I am getting the following error when I select a row in the lazy datatable :
javax.faces.FacesException: Method not found: com.gestion.projet.web.jsf.ProjetComponentImpl#f632823.onRowSelect(org.primefaces.event.SelectEvent)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:85)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
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.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:113)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
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)
and then the code associated with the following bean method:
#Scope("session")
#Component("ProjetComponent")
public class ProjetComponentImpl implements ProjetComponent {
public void onRowSelect(SelectEvent event) {
FacesMessage msg = new FacesMessage("Projet Selected", ((Projet) event.getObject()).getIdprojet().toString());
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}
and this the xhtml page:
<h:form id="form">
<p:dataTable var="current" value="#{ProjetComponent.lazyModel}"
paginator="true" rows="10"
paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
rowsPerPageTemplate="5,10,15" selectionMode="single"
selection="#{ProjetComponent.projet}" id="projetTable" lazy="true">
<p:ajax event="rowSelect" listener="#{ProjetComponent.onRowSelect}"
update=":form:projetDetail" oncomplete="PF('projetDialog').show()" />
<p:column headerText="Id" sortBy="#{current.idprojet}" filterBy="#{current.idprojet}">
<h:outputText value="#{current.idprojet}" />
</p:column>
<p:column headerText="Nom" sortBy="#{current.nomprojet}"
filterBy="#{current.nomprojet}">
<h:outputText value="#{current.nomprojet}" />
</p:column>
</p:dataTable>
<p:dialog header="Projet Detail" widgetVar="projetDialog" modal="true"
showEffect="fade" hideEffect="fade" resizable="false">
<p:outputPanel id="projetDetail" style="text-align:center;">
<p:panelGrid columns="2"
rendered="#{not empty ProjetComponent.projet}"
columnClasses="label,value">
<f:facet name="header">
</f:facet>
<h:outputText value="Id:" />
<h:outputText value="#{ProjetComponent.projet.idprojet}" />
<h:outputText value="Nom:" />
<h:outputText value="#{ProjetComponent.projet.nomprojet}" />
</p:panelGrid>
</p:outputPanel>
</p:dialog>
</h:form>
this is a snaphshot of what i get when i select a row :
Seems you're interchanging Spring Annotations with JSF annotations - PrimeFaces is a JSF component library in use with a JSF Managed Bean - #SessionScope and #ManagedBean(name="projectBlah")
from the javax.faces.bean packages
So i basicly have a tree inside a collapsible and is iterating with a ui:repeat or ice:panelSeries because they pretty much have the same structure
<ui:repeat value="#{navigationBean.navigationPanels}" var="panel" >
<ice:panelCollapsible immediate="true" expanded="#{panel.expanded}" >
<f:facet name="header">
<ice:panelGroup>
<ice:outputText value="#{panel.title}" />
</ice:panelGroup>
</f:facet>
<ice:panelGroup styleClass="treeContainer">
<ice:tree id="tree" value="#{panel.treeModel}" var="item"
hideRootNode="true" hideNavigation="true"
imageDir="#{facesContext.externalContext.requestContextPath}/xmlhttp/css/xp/css-images/">
<ice:treeNode>
<f:facet name="icon">
<ice:panelGroup style="display: inline">
<h:graphicImage
value="#{userPreferences.imageDirectory}/#{item.userObject.icon}" />
</ice:panelGroup>
</f:facet>
<f:facet name="content">
<ice:panelGroup style="display: inline">
<ice:outputLink value="#{item.userObject.url}">
<ice:outputText styleClass="treeNode" value="#{item.userObject.text}" />
</ice:outputLink>
</ice:panelGroup>
</f:facet>
</ice:treeNode>
</ice:tree>
</ice:panelGroup>
</ice:panelCollapsible>
</ui:repeat>
The problem is that when i expand or collapse the panel gives me an awful error here is the stack:
java.lang.NullPointerException
at com.icesoft.faces.component.tree.Tree.visitRows(Tree.java:1447)
at com.icesoft.faces.component.tree.Tree.visitTree(Tree.java:1402)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487)
at com.sun.faces.facelets.component.UIRepeat.visitTree(UIRepeat.java:606)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487)
at javax.faces.component.UIForm.visitTree(UIForm.java:331)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487)
at com.sun.faces.lifecycle.RestoreViewPhase.deliverPostRestoreStateEvent(RestoreViewPhase.java:258)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:245)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:380)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Any idea why it could be behaving like this??
According to the source, #{panel.treeModel} evaluates to null.
Try <ice:tree rendered="#{panel.treeModel != null} ..., and see what happens.
It could be that the the problem does not occur at rendering. It could occur while building the server side component tree. On such cases you have to make sure that the xml tag <ice:tree../> is not parsed at all.
So try:
<c:if test="#{not empty panel.treeModel}"> <ice:tree ../> </c:if>
This is not working in all cases. So give it a try :-)