I am trying to reset some text input fields inside a data table using the cancel button. The problem that I am facing is that if I try to cancel it, but there are validation errors, this does not allow me to do this, because it first performs the verification, finds and displays an error and displays an error before it can re-register yourself.
The obvious solution is to set "immediate = true" to the button. This eliminates the problem and allows me to cancel without checking, but the fields themselves are not set to their original values. This is because the components themselves never return data from a BECAUSE beans backup for an immediate value of true.
This is very well explained in this article: http://wiki.apache.org/myfaces/ClearInputComponents
The article presents many solutions, but none of them work for me.
- I need to stay on one page, so changing the view is not an option.
- I cannot reset the values ββof ALL input fields on the page, because I want only the "line" that I canceled to be reset
I cannot bind components to any of the input fields because, because they are in a datable state, the binding attribute of the input field itself cannot refer to the variable 'var'. For example, the following βbindingβ attribute is illegal and gives me an error:
<ice: dataTable id = "poolSharesTbl" var = "node" value = "# {poolSharesManager.nodeModel}" ... & L; ice: column> <ice: inputText binding = "# {node.inputTextBinding}" ...
This may be due to "var" only in the query area.
Anyway, does anyone have any ideas on how to make this work?
source share