Thanks for tip, I moved the source/column initialization out of
pageBeginRender and move it to the getters (init if needed). Everything is
working even with caching disabled.
----- Original Message -----
From: "Andreas Andreou" <[EMAIL PROTECTED]>
To: "Tapestry users" <[email protected]>
Sent: Friday, January 27, 2006 4:27 AM
Subject: Re: Contrib table pagination problems
Daniel,
caching is not the cause of this problem, and it certainly isn't the
cure for it either.
From the exceptions, I assume that you're specifying the source and the
columns parameters
of the table component and once you navigate to the next page one of
them turns null
(usually it's the source).
Also, it looks as if you're handling the component or page property (for
the table source) yourself,
instead of letting Tapestry handle it (by defining it in the .jwc or
.page and using abstract getters -
setters in your java class). And most probably you aren't clearing it to
null after the page (or the component)
renders.
So, the actual problem is that on first access you load the data and then:
- With caching disabled, when going over to the next page, it gets
reloaded and your data are lost
- With caching enabled, the next page is obtained from the pool and
you're lucky (or unlucky!) enough so
that you get the previous instance which contains the previously loaded
data.
As a rule, you must always check your site with caching disabled, as
this will reveal hidden problems.
For a solution:
- define a (tapestry) property for your data, and persist it in session.
or
- fetch the data inside your getData() method
(assuming you have <table jwcid="@contrib:Table" source="ognl:data" ...
/> )
Andreas Andreou
Daniel Lydiard wrote:
I figured out the problem :)
If caching is turned off, you'll get the error.
So: -Dorg.apache.tapestry.disable-caching=false = Tables will paginate.
and -Dorg.apache.tapestry.disable-caching=true = Tables will not
paginate.
----- Original Message ----- From: "Chris Chiappone"
<[EMAIL PROTECTED]>
To: "Tapestry List" <[email protected]>
Sent: Thursday, January 26, 2006 2:05 PM
Subject: Contrib table pagination problems
I get the following exception when using the auto pagination from
contrib:table
Either the tableModel parameter or both source and columns parameters
must be specified by component CompanyProfile/apps.table.tableView
Stack Trace:
org.apache.tapestry.contrib.table.components.TableView.getTableModel(TableView.java:220)
org.apache.tapestry.contrib.table.components.TablePages.setCurrentPage(TablePages.java:191)
org.apache.tapestry.contrib.table.components.TablePages.changePage(TablePages.java:183)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeTargetMethod(ListenerMethodInvokerImpl.java:214)
org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:155)
org.apache.tapestry.listener.ListenerMethodInvokerImpl.searchAndInvoke(ListenerMethodInvokerImpl.java:124)
org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(
The problem is I'm not exactly sure what I am missing here?
--
~chris
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]