Thanks Robert, I was unaware of the Cached annotation.

Peter

On Tue, Apr 8, 2008 at 11:13 AM, Robert Zeigler <[EMAIL PROTECTED]> wrote:

> This is the expected behavior for pageLoaded. See:
>
> http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/org/apache/tapestry/annotations/PageLoaded.html
> In particular:
> "This is useful for one-time component initializations..."
>
> How about using the @Cached annotation on the getAllCategories() method?
> I haven't used @Cached, personally, but my understanding of it is that it
> caches the results on first call to the method, for that particular request.
> On next request, the results will once again be refreshed, and the new
> results cached for that render.  You get the benefit of decreased overhead
> (you're not hitting the db every time getAllCategories() is called),
> and you still get the most up to date dataset.
>
> Cheers,
>
> Robert
>
>
> On Apr 8, 2008, at 4/810:01 AM , Peter Beshai wrote:
>
> > My current workaround it to just grab from the database on every
> > getAllCategories() call and get rid of the pageLoaded method. I'd be
> > interested to hear if there are any different approaches.
> >
> > Peter Beshai
> >
> > On Tue, Apr 8, 2008 at 10:51 AM, Peter Beshai <[EMAIL PROTECTED]>
> > wrote:
> >
> >  I have a block in my AppPropertyEditBlocks that grabs a list of data
> > > from
> > > the database, which works fine. The problem happens if I modify what
> > > should
> > > be in that list (say I add another row to the db), the edit block
> > > doesn't
> > > update it's list. I currently am populating the list in the pageLoaded
> > > method:
> > >
> > > void pageLoaded()
> > > {
> > >   _allCategories = _categoryDAO.findAll();
> > > }
> > >
> > > Any idea what I can do to fix this?
> > >
> > > Peter Beshai
> > >
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to