You need to make the currentPage property a persistant property.
Invoke fireObservedChange() from its setter method.
Clear it out in detach(). Alternately, implement an initialize(). See the
JavaDoc for more details.
Tapestry stores persistent properties between request cycles within the
user's HttpSession. When the page is next accessed, the properties are
restored.
----- Original Message -----
From: "Edy Toha" <[EMAIL PROTECTED]>
To: "Malcolm Edgar" <[EMAIL PROTECTED]>; "tapestry-developer"
<[EMAIL PROTECTED]>
Sent: Wednesday, December 11, 2002 2:14 AM
Subject: Re: [Tapestry-developer] Cache problem
> Malcom,
>
> I have this :
>
>
> private int _currentPage = 1;
> private int _resultCount;
> private int _pageCount;
>
> public void detach(){
> // _currentPage = 1;
> // _resultCount= 0;
> // _pageCount=0;
> super.detach();
> }
>
> I can't set _currentPage to 1 in detach() because when I click to next
> page, it will goes to the page 1.
> I took some code from vlib, the differences that vlib uses 'Browser'
> component, and I take some browser code without component.
>
> Is there another way? or should I code just like vlib?
>
> Thanks
>
> Regards
>
> Edy Toha
>
> Malcolm Edgar wrote:
> > Hi Edy,
> >
> > it could be you are not detaching the page property, i.e. setting the
> > page attributes to null before the page is returned to the pool
> > you need to ensure that you are detaching the page property. For
example:
> >
> > public class MySearchPage extends BasePage {
> > private Integer pageNumber;
> >
> > public Integer getPageNumber() { return pageNumber; }
> >
> > public void detach() {
> > pageNumber = null;
> > super.detach()
> > }
> > }
> >
> >
> >> From: Edy Toha <[EMAIL PROTECTED]>
> >> To: [EMAIL PROTECTED], [EMAIL PROTECTED]
> >> Subject: [Tapestry-developer] Cache problem
> >> Date: Wed, 11 Dec 2002 11:38:15 +0700
> >>
> >> Hi,
> >> Actually I really don't know, it's cache problem or something else
> >> I made a searching page that contains info page number, current page
> >> and other things.
> >>
> >> The problem exists when 2 users got connected to server and opening
> >> the same page, example "SearchPage".
> >> If #1 user enter key for search and jump to next page of search
> >> result, when the #2 user goes to "SearchPage" he will have same page
> >> and same "search key" just like #1
> >>
> >> 1. Is it because that both user using same page number and same key
> >> that stored in cache?
> >> 2. How to avoid this? disabling-cache can't help much. because i must
> >> store currentpage and pagenumber variable.
> >>
> >>
> >> Thanks for Help
> >> If there is already discussed topic about this, would you mind to give
> >> me url address,
> >>
> >> Regards
> >>
> >> Edy Toha
> >>
> >>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:
> With Great Power, Comes Great Responsibility
> Learn to use your power at OSDN's High Performance Computing Channel
> http://hpc.devchannel.org/
> _______________________________________________
> Tapestry-developer mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/tapestry-developer
>
-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer