> That's not a workaround, it's a matter of what is called first.

In theory it could be both things, however I realized that you're right that 
it's not a workaround when I compare it to the structure outlined by Geoff, 
which sounds like the proper structure. It was sounding to me like a workaround 
because I believed that the proper structure was to retrieve the values only 
from the getter when Tapestry calls it, and not from setupRender, and this 
turned out to be wrong, so I no longer consider it a workaround.

Thanks Geoff for the thorough explanation, much appreciated. I actually had 
ended up doing basically that, except that from setupRender I explicitly call 
the getter to set up the value instead of calling a setupValue method, but the 
need to explicitly call the getter was actually the part that perplexed me. I 
think having a setupValue method called from setupRender that calculates the 
value and having the getter to simply return that value as in your example is 
much cleaner, I will go for that.

In my opinion it's also remarkable that the order in which the elements appear 
in the template made the difference. Now that it was mentioned it sounds 
obvious but I had not realized that earlier. If in the template of my initial 
example I just move the ${myValue} above the error zone, it works as I had 
expected, that is the message is shown, because the message is set in the 
getter which is now called before the error zone is rendered.
However I don't think it's a good idea to rely on the order of the elements in 
the template, so I will stick to calculating in setupRender the values for the 
getters to return.

Thanks all for the assistance !



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to