-
1. Re: Partial load of data for DataTable
pmuir Aug 9, 2006 4:57 AM (in response to gvl)Why not load all the rows at the start of a conversation and then only display the ones needed - avoids too many dataloads (which I would assume you are trying to avoid) and means you can use @DataModel/@DataModelSelection. Or perhaps you could lazy load the data - when the next button is pressed check whether you have the needed rows loaded from the database, and if they aren't, load them.
-
2. Re: Partial load of data for DataTable
gvl Aug 9, 2006 5:39 AM (in response to gvl)Thank you for your reply,
My goal here is to avoid loading a large batch of data all at once and do a lazy load as you say.
So I tried to attach an action listener on the scroller and catch when a user hits the forward button. However I got the following NullPointerException:java.lang.NullPointerException at org.jboss.ejb3.entity.ExtendedEntityManager.getPersistenceContext(ExtendedEntityManager.java:59) at org.jboss.ejb3.entity.ExtendedEntityManager.createNamedQuery(ExtendedEntityManager.java:134) at gr.aegek.invent.business.BrowseBean.loadEntities(BrowseBean.java:278) at gr.aegek.invent.business.BrowseBean.loadAll(BrowseBean.java:243) at gr.aegek.invent.business.material.BrowseMaterialsBean.load(BrowseMaterialsBean.java:129) at gr.aegek.invent.business.ScrollerActionListener.processAction(ScrollerActionListener.java:43) at javax.faces.event.ActionEvent.processListener(ActionEvent.java:48) at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:484) at org.apache.myfaces.custom.datascroller.HtmlDataScroller.broadcast(HtmlDataScroller.java:104) at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168) at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595)
I am using an extended entity manager:@PersistenceContext (type=PersistenceContextType.EXTENDED) protected EntityManager manager;
I am not quite sure what is wrong then here! -
3. Re: Partial load of data for DataTable
pmuir Aug 9, 2006 5:53 AM (in response to gvl)Looks to me that call isn't going through EJB. You seem to have a chain of methods being called - are you injecting them? Can you post code?
-
4. Re: Partial load of data for DataTable
gvl Aug 9, 2006 8:46 AM (in response to gvl)Yup,
that was the problem, the methods were called directly from one object to the other.
Thanx
--
George -
5. Re: Partial load of data for DataTable
wjmca Aug 23, 2006 10:48 AM (in response to gvl)We are trying to do the same thing and just aren't getting something, any chance you can provide your before and after code snippets... Thanks!
-
6. Re: Partial load of data for DataTable
trouby Oct 12, 2006 8:05 PM (in response to gvl)Hey,
Is there any examples of this? I'd like to do exactly the same with Tomahawk datatable !
Thanks