My Layout component has a message parameter of type Block that gets displayed if set. Pages that should display messages derive from a base class with a message page property of type string. In the page's template I then bind Layout's message parameter to the page's message property (coercion from String to Block is done automatically by Tapestry). In an event handler I then acquire a page instance by injecting it, set the message and return that page.

HTH,

Uli

On 13.08.2009 09:19 schrieb dirk.latterm...@bgs-ag.de:
Hi list,

while trying to grasp the "tapestry way of doing things", I stumbled on this question:

I want to show a message in response to a submit. It is not a result of validation, but rather of the database state which is detected during data manipulation in the onSuccess event. For example, the submit is supposed to delete several entries in a database, some of which may have been removed by another process between the user selecting them and submitting the form. If this is the case, I want to show a friendly message to inform the user about this fact.

Normally, after a submit, the same page should be re-displayed with updated data. I'm not sure how to incorporate the messages there.

Can I use something similar to the <t:errors/> component for this? That one uses a wording adapted to the input validation and uses error colors which don't fit here. Maybe I need to implement some similar behaviour by hand via properties into which the messages are put and display these "by hand" in the tml template?

Another way would be to use an "exception page". Can I use a special exception page that gets called automatically for some special type of exceptions? A normal page especially for user messages could be used, too, but what is preferred way?

Is there a way that tapestry suggests for this situation, as it does for input validation?

Thank you,
Dirk
BGS Beratungsgesellschaft Software Systemplanung AG Niederlassung Köln/Bonn Grantham-Allee 2-8 53757 Sankt Augustin Fon: +49 (0) 2241 / 166-500 Fax: +49 (0) 2241 / 166-680 www.bgs-ag.de Geschäftssitz Mainz Registergericht Amtsgericht Mainz HRB 62 50 Aufsichtsratsvorsitzender Klaus Hellwig Vorstand Hermann Kiefer Nils Manegold Thomas Reitz

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

Reply via email to