Show errors

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Show errors

Dirk Verleysen-2
Janko,

what is your experience on showing errors to the user ? Create a special ErrorApp for this ?

Dirk
------------- volgend deel ------------
Een HTML-bijlage is verwijderd...
URL: http://lists.aidaweb.si/pipermail/aida/attachments/20071017/bbbd0ae2/attachment.htm 

Reply | Threaded
Open this post in threaded view
|

Show errors

Janko Mivšek
Dirk,

Dirk Verleysen wrote:

> what is your experience on showing errors to the user ? Create a special
> ErrorApp for this ?

You can use a buit-in support in WebApplication. There are
#error/#error: and #errorReport methods. A simple rule is that if you
set an error with some text, then an errorReport element will return
that text in red.

You can put that errorReport element somewhere on your page (usually
above an entry form) and set error in your action method after
verification of submitted data, then reload that same view. For example:

viewMain
   self add: self errorReport
   self addInputFieldAspect: #entry of: self observee.
   self addButtonText: 'submit'

actionMain
   self observee isEntryValid ifFalse:
     [self error: 'Entry not valid!'.
     self redirectToView: #main].
   ...

Now always when entry is not valid, an error text in red will be shown
above entry field and user can try again.

Best regards
Janko

--
Janko Miv?ek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si