If I changed the value of my component test, the text zone is enabled, but the value is not sent to the managed bean, so I suppose JSF checks its component tree before setting values, and this component was initially disabled that's why the value is not submitted.
What do you suggest to get the value on server side ?
I can get it in the request but I would like to know if we have a way to avoid that.
Customer surveys are for companies who didn't pay proper attention to begin with.
Joined: Mar 19, 2012
Thanks for you help,
indeed, if the component is initialized with disabled set to true, it will not be in the JSF tree, so matching values will not be submitted.
As you suggest two ways to avoid that :
- If we prefer to manage it completely with JSF, when we want to switch the disable state, we must trigger an Ajax event which will reassess the EL expression set on disabled attribute of the inputText.
If the component was set to disabled, so not present in the jsf tree, during the ajax request to enable it, it will be added, so the value may be submitted later
This solution will cost a request on the server..., just to change an element state
The perfect solution should be to manage the disable state with JSF and WITHOUT such an Ajax request but, I don't know why JSF specifies to not introduce disabled element in the JSF tree, because in my opinion
disabled during initialization phase does not mean disabled for all the component life.