• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic values for JSF selectOneMenu using javascrpt. JSF validation error.

 
Swaminathan Natarajan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Im using Myfaces 1.2 (tomahawk) . I have a very bulky page having lot of drop down menus. It has a datatable containing four drop downs in a row and the datatable has close to 40 rows (with pagination) . Each of the drop downs have close to 100 items . This makes the page size very huge and not suitable for an internet application.

Im thinking of a way to have the drop downs populated using javascript in body onload event so that the page size reduces drastically. I have defined a selectOneMenu without selectItems. So before page load there will be no items in the drop down. The body onLoad method populates the drop downs and the page gets rendered as expected. All the javascript events related to these drop downs works fine. When page is submitted i want the selected value in the bean variable.


But when the page gets submitted im getting the error

Validation Error: Value is not valid

Can someone let me know the reason behind this and a way to solve this problem . Its really URGENT...
Please help....

Thanks,
Swami.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would probably be better off using an AJAX-friendly tag library like RichFaces instead of trying tedious brute force with Tomahawk. RichFaces prefers to extend basic JSF tag capabilities where possible, so the work of converting is often very small.

Note that if you really feel the need to load that much data via JavaScript/AJAX before the page is usable, the process of loading the page via onLoad-requested operations is going to be even slower than loading the whole page and its data via a single page request.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic