You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by di...@bgs-ag.de on 2009/08/13 09:19:31 UTC

User/error message that are not validation errors

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 

  

Re: User/error message that are not validation errors

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Thu, 13 Aug 2009 04:19:31 -0300, <di...@bgs-ag.de> escreveu:

> Hi list,

Hi!

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

I created a simple Message component. It has a message parameter (String).  
If the message is not null, it renders a <p class="message"> tag with the  
message inside it. I use this component inside Form.

> 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?

You can use the tapestry.exception-report-page configuration symbol to  
tell Tapestry which error page it must use. Don't forget to make your  
error page implement the ExceptionReporter interface.

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Re: User/error message that are not validation errors

Posted by Ulrich Stärk <ul...@spielviel.de>.
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.lattermann@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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org