Saturday Apr 26, 2008

VW user tip2: User Friendly Error Messages For Woodstock AutoValidation

One of the powerful features of  Woodstock TextField components bundled with Netbeans Visual Web is, client side auto validation. However, it is kind of tricky, if you want to change the default messages it displays. David Heffelfinger sent me this neat tip on how to achieve this.

For other user tips, visit Netbeans Visualweb user tips and code snippets


A while back I was experimenting with Woodstock. One of the things I liked about it was the "ajaxified" auto validation of text fields and text areas. Unfortunately when I tried it out I was disappointed that neither <h:message> nor <webuijsf:message> would "catch" validation errors when auto validation "kicked in". Reading about it I noticed that we can use an alert component to display validation errors, via the "notify" attribute.

Unfortunately by default both the "Header" and the "body" of the alert display the same message, not exactly user friendly.

After some research I found a solution, we need to override the "detail" and "summary" error messages via a resource bundle.

I blogged about this at http://www.jroller.com/heffel/entry/user_friendly_error_messages_for


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today