Hello All, I have 2 pages, page A and B. Page A is a page that allow user to
search, the result will be shown in a table with the link to the page B.
Page B will have a "Back" button to navigate back the previous page which is
page A (with the details that was entered previously). But I've encountered
the problems on restoring the *Table* object from the previous page. If I
saved the whole page object to the state, shouldnt it saved all the
instances inside the object which wouldnt cause the problem of
NullPointerException on getting the TableModelSource? What did i do it
wrong?
Page A will be saved into the "*tapestry.state.ApplicationObjects*" with the
scope of "*session*".
Im not sure if the design of mine that navigate between pages is correct,
anyone can help?
Thanks in advanced.
Mike,
java.lang.NullPointerException Stack Trace:
-
org.apache.tapestry.contrib.table.components.AbstractTableViewComponent.getTableModelSource
(AbstractTableViewComponent.java:35)
-
org.apache.tapestry.contrib.table.components.TableColumns.getTableColumnIterator
(TableColumns.java:91)
- 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)
*Page A:*
@InjectState("pageA")
public abstract void setPage(BasePage page);
public void toPageB()
{
setPage(this);
}
*Page B:*
@InjectState("pageA")
public abstract BasePage getPage();
public void toPageA(IRequestCycle cycle)
{
PageA pagea = (PageA) getPage();
cycle.activate(pagea);
}