Forgive the "newbness" of this question, but I'm just curious. Let's say if
have a page class similar to the following:
public class ProductPage extends BasePage{
private Product product
public getProduct(){return product;}
public setProduct(Product product){this.product=product;}
@InjectPage("ExtraProductInfoPage");
public abstract ExtraProductInfoPage getExtraProductInfoPage();
public ExtraProductInfoPage onClickExtraProductInfoLink(){
getExtraProductInfoPage.setProduct(product);
return getExtraProductInforPage();
}
}
Ok, as you can see, I'm attempting to access a page property from within my
listener. the listener is called when someone clicks a DirectLink on the
ProductPage page. I'm guessing that this it is incorrect to access page
properties in this manner, because I'm having sporadic issues with the
product that I'm passing to the next page being null.
First, am I correct in assuming what I'm trying to do here won't work? For
some reason, I thought I had understood that Tapestry used the session to
automatically maintain the page properties between the initial request and
the form submissions or links from the page that had been requested. I
assumed that this meant I could access the page properties from my listener
when it was called.
If this usage is not correct, then is there a way to ensure that I can use
the Product object again in my listener without requerying it from my
database? I suppose I could pass the entire Product object as a parameter to
the DirectLink, but won't that produce a URl that's extremely heavy?
Again, I apologize for what I'm sure is an uninformed question. I searched
the mail archives and wasn't able to discover an answer on my own.