On Tue, 25 Mar 2014 12:33:30 -0300, Davide Vecchi <[email protected]> wrote:
Hi,
Hi!
The jumpstart examples linked by Geoff Callender are also useful but
they show how to update a zone in response to a user's action (clicking
on a link or button) while in my case I need to update a zone in
response to "nothing" - that is, in response to an error occurred during
the initial page loading, before any possible user's action.
That's the whole point: you don't need AJAX nor zones for that. A zone is
meant to be updated after the initial page loading, usually by user
action, but also possibly by some timer.
I have a zone to show possible errors that might occur in a get* method
called by Tapestry during page rendering to retrieve the value for a
property (String myValue in the example below).
Why do you want for that to happen inside a getter? It does look like a
wrong thing for me. Getters are mostly expected to not have
side-effects.
This point is quite unclear to me. I did so because I think that in a
web page the getter is the right place to put the code that retrieves a
value to show in the page.
Yeah, I agree with you. I'm sorry for posting that paragraph.
I could calculate in the setupRender method the return values for all
the getters, store them in @Persist fields and just return those fields
from the getters.
If these values are used in the initial page rendering, as it's the case
here, you don't need to @Persist them at all. The values of the fields
will be kept until the request is finished.
Plus I don't know if one can update a zone from the setupRender method.
It makes absolutely no sense to do that, as I already explained above,
because zones are not meant to be updated during the page rendering.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]