I have come across some situations in which input controls are used that do not have the value
attribute set, i.e. they have no direct representation in the backing bean.
User input is handled entirely by ajax listeners. An example are the input elements of the column filters in the primefaces table.
However, when dealing with such input fields, MyFaces warns me about each:
Feb 09, 2017 3:04:51 PM javax.faces.validator.BeanValidator validate
WARNING: cannot validate component with empty value: my_form:myTableId:j_id_1s
In a way, this problem has already been mentioned here: p:datatable filter: cannot validate component with empty value
My question is: What is the best practice in situations like this?
- An input element should always have a reference in the backing bean, everything else is a design error
- Just use a "dummy" value that points to an unused field in the bean.
- Suppress the validation of that input element. (How?)
- Suppress the MyFaces warning somehow. (How?)