If you want to convert a text of field to uppercase 2 possible solutions in my opinion
- link the function with the InputValue of the component.
- Covert the value in setter method of the ViewObjectImpl class
Solution 3: (Updated on July 10, 2010)Found great and better solution by Chris Muir (better than mine)
In this example:
- I will use Solution 1 on the First Name field
- I will use Solution 2 on Last Name field.
Note: Solution 1 in my opinion is better choice which is faster and less overhead on application
Solution 1 by Frank Nimphius
Here is the post by Frank Nimphius
1. drag and drop an input text field to the filter facet of a column2. create a JS function as shown below
3. Drag and drop an af:clientListenener to the input text field to reference the JS function
- Generate RowImpl java class on EmployeView View Object by double clicking go to Java tab press the pencil icon on the top right and check the options.
- Change value to value.ToUpperCase() in the method of setLastName as shown in the slide
- Set AutoSubmit to TRUE of LastName field in JSF page
Run the application Enter "steve" in the First Name field and tab out you will notice it will automatically convert to "STEVE" do the same for Last Name enter "king" and tab out it will convert to "KING"
Download the example workspace