You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lothar Nieswandt <lo...@gmx.de> on 2010/09/03 15:52:14 UTC

[T5] Inline display of general exceptions

Hi there, 

I would like to display exceptions that occur in my pages in a user friendly way. Mostly they originate from the underlying Web Service Backend. 
I like the layout used by the "Errors" component (red square). So my first thaught was: why not use this component. However, when trying to achieve this I found that the purpose of 'Errors' is to display ValidationExceptions that occur in forms. 
How can this mechanism be extended to general runtime exceptions thrown in onActivate() and possibly other event handlers? 
I know how to customize ExceptionReport, but this is not what I want. I would like to see those red squares on the top of the screen that are embedded in the page. 

Thanks for any advice. 

Lothar 
-- 
GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 Euro/mtl.!*
http://portal.gmx.net/de/go/dsl

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


Re: [T5] Inline display of general exceptions

Posted by Howard Lewis Ship <hl...@gmail.com>.
To be honest, I'd define a different object to store the exceptions,
and a matching component to display them.

For one of my clients, I've been working on a generalized way to store
application messages (info, warning, error) and control how long they
are displayed (once, until dismissed, until page changes).   I may be
able to spin that off into a general purpose library (perhaps under
the tapx umbrella).

On Fri, Sep 3, 2010 at 7:05 AM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> On Fri, 03 Sep 2010 10:52:14 -0300, Lothar Nieswandt <lo...@gmx.de>
> wrote:
>
>> Hi there,
>
> Hi!
>
>> I like the layout used by the "Errors" component (red square). So my first
>> thaught was: why not use this component. However, when trying to achieve
>> this I found that the purpose of 'Errors' is to display ValidationExceptions
>> that occur in forms.
>
> Not just validation errors. You can get the ValidationTracker from the
> Environment and use void recordError(String errorMessage) to record a
> message.
>
> @Environmental
> private ValidationTracker validationTracker;
>
> Or inject the form and use the recordError() (which just delegates to the
> ValidationTracker.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Re: [T5] Inline display of general exceptions

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 03 Sep 2010 10:52:14 -0300, Lothar Nieswandt <lo...@gmx.de>  
wrote:

> Hi there,

Hi!

> I like the layout used by the "Errors" component (red square). So my  
> first thaught was: why not use this component. However, when trying to  
> achieve this I found that the purpose of 'Errors' is to display  
> ValidationExceptions that occur in forms.

Not just validation errors. You can get the ValidationTracker from the  
Environment and use void recordError(String errorMessage) to record a  
message.

@Environmental
private ValidationTracker validationTracker;

Or inject the form and use the recordError() (which just delegates to the  
ValidationTracker.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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