JSF Richfaces best practice: drop down and data scroller

Reading Time: < 1 minute

Last Updated on November 10, 2011 by stlplace

drop down box
Clear a list for selectionOneMenu every time, got burned by this in a “page number” drop down for Richfaces data scroller. And some other places.

Use validator
keep in mind it will overwrite the required = “true”, if the user does not select a valid value from drop down, it will give error message during Save method.

Assign 0 to “–select–” ?
Yes or no. Add 0 means 0 is a selectable option, so if one wants to enforce user to select something using required=”true”, it will pass this check. Thus comes in the validator, in which one can say “0” is not valid.

Page number for data scroller
1) t:saveState if we can not have session scope for dataBean;
2) the drop down tip above;
3) When “adding or deleting rows” and it cause the total number of pages changes, make sure set the correct page number in the “action” (save) methods.

Comments

One response to “JSF Richfaces best practice: drop down and data scroller”

  1. […] look as well – and a third, a fourth, a fifth, and as many more as fast as technology can travel. Smartphones have become a ubiquitous part of daily life, particularly for the younger set. Those of …it seems as though the latest smartphones can do everything but physically make you dinner. There […]

Leave a Reply

Your email address will not be published. Required fields are marked *