Hi!
I already read the description of the "preserveDataModel" attribute of the
dataTable on the Apache MyFaces Web site, but I don't really understand the
problem that mighty cause runtime failures using the dataTable with dynamic
model updates.
I don't use the "preserveDataModel" currently (it's set to false), and I
change the data model when the user presses the delete button to delete some
rows, for example. But I don't encounter any problem.
Can anybody explain the "preserveDataModel" problem, I why I don't have this
problem?
In contrast, when I set the "preserveDataModel" attribute to true, and try
to leave the site via a commandLink, I get the following error message:
01:28:05,625 ERROR [Engine] StandardWrapperValve[Faces Servlet]:
Servlet.service() for servlet Faces Servlet threw exception
javax.faces.el.EvaluationException: Cannot set value for expression
'#{FragenBacking.fragenModel}' to a new value of type org.apache.myfaces
.component.html.ext._SerializableDataModel
at
org.apache.myfaces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:307)
at
org.apache.myfaces.component.html.ext.HtmlDataTable.updateModelFromPreserved
DataModel(HtmlDataTable.java:260)
at
org.apache.myfaces.component.html.ext.HtmlDataTable.processUpdates(HtmlDataT
able.java:242)
at javax.faces.component.UIForm.processUpdates(UIForm.java:85)
at
javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:62
7)
at
javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:153)
at
org.apache.myfaces.lifecycle.LifecycleImpl.updateModelValues(LifecycleImpl.j
ava:296)
at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:81)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)
at
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsF
ilter.java:123)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:186)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.ja
va:75)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:186)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:198)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:152)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalVal
ve.java:66)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssoci
ationValve.java:150)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:
54)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137
)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118
)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:705)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:683)
at java.lang.Thread.run(Thread.java:534)
Caused by: javax.faces.el.EvaluationException:
de.fhzw.portal.umfragesystem.view.backing.management.fragen.FragenBacking
at
org.apache.myfaces.el.PropertyResolverImpl.setValue(PropertyResolverImpl.jav
a:185)
at
org.apache.myfaces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:272)
... 44 more
Caused by: javax.faces.el.EvaluationException: Bean:
de.fhzw.portal.umfragesystem.view.backing.management.fragen.FragenBacking,
property: fr
agenModel
at
org.apache.myfaces.el.PropertyResolverImpl.setProperty(PropertyResolverImpl.
java:403)
at
org.apache.myfaces.el.PropertyResolverImpl.setValue(PropertyResolverImpl.jav
a:173)
... 45 more
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.myfaces.el.PropertyResolverImpl.setProperty(PropertyResolverImpl.
java:399)
... 46 more
Does anybody know how to solve that problem?
Another question related to the dataModel. I don't know if the
"preserveDataModel" approach can help, but when the user leaves the site
with the table because the user selected an edit link in the table, and then
returns to the site with the table, I cannot use the getRowData() method to
determine the last row selected. If I do that, I get the following error
message:
...
Caused by: java.lang.IllegalArgumentException: row is unavailable
at javax.faces.model.ListDataModel.getRowData(ListDataModel.java:61)
...
The getRowData() method is invoked when the user presses a button on the
second site to return to the table site. Is it possible at all, to ask the
dataModel in that context?
(I use Nightly 20051130 (myfaces-all.jar))
Regards,
Matthias
Regards,
Matthias