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


Comments:

Hi Winston,

Thanks for the tip.

One thing I find is that Visual JSF pages for some reason does not send gzipped data. Why would that be? A simple tree component on my website generates over 500 KB of data. That is terrible. Any advice on getting the size down when using Visual Web, JSF and Woodstock?

Regards

Posted by Jacobus on April 29, 2008 at 03:05 PM PDT #

Jacobus, are you using NB 6.1? They are gzipped in NB 6.1. See here for details
https://woodstock.dev.java.net/servlets/ProjectForumMessageView?messageID=23417&forumID=2879

Posted by Winston Prakash on April 29, 2008 at 11:26 PM PDT #

Winston, hi, thanks for the link. I am using Netbeans 6.1, but the problem is that Woodstock is gzipping in only the javascript and CSS files, which the browser should cash in any way. The killer is the HTML page itself. A medium sized table (about 20 columns by 50 rows) can easily use over a Meg and as I mentioned earlier, my tree menu (which has less than a hundred nodes in total) is almost 600 kB. Over a 32 kB/s line, which is a good connection in South Africa, and many other countries, you are looking at between 20 and 30 seconds wait everytime the page is called. Use this in a data capturing application, and you have users screeming and moaning constantly.

The only thing I can think off is to write my own GZIP filter. Any other ideas?

Thanks for answering in the first instance....cheers, Jacobus

Posted by Jacobus on April 30, 2008 at 04:34 AM PDT #

Hi Jacobus,Glassfish supports HTTP compression as well Tomcat. See for details http://weblogs.java.net/blog/jfarcand/archive/2006/06/enabling_http_c_1.html.

Also make sure to understand between JSF client side state saving and server side state saving to decrease the network traffic. Read here for more details http://weblogs.java.net/blog/jhook/archive/2006/12/jsf_statesaving_1.html

Posted by Winston Prakash on May 10, 2008 at 11:13 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
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