Originally posted by Gregg Bolinger:
Working on a form I ran into a strange thing that I can't find any documentation on. I have a form with some non-editable information that I need displayed and then below that there is some editable information.
If I use outputText for the non-editable data and submit the form, when/if validation fails and the form returns the outputText values are blank. So I switched to inputText components with disabled="true". And guess what, the same thing happens. So I used an inputText with readonly="true" and this worked the way I wanted it to.
Now, if I put the managed bean in the session it seems to work just fine anyway I want to do it. But putting it in the request makes this happen. Does anyone have an explination for this?
"At the end of APPLY_REQUEST_PHASE, all EditableValueHolder components in the component
tree will have been updated with new submitted values included in this request (or
enough data to reproduce incorrect input will have been stored, if there were
conversion errors). In addition, conversion and validation will have been performed on EditableValueHolder components whose immediate property is set to true.
Conversions and validations that failed will have caused messages to be enqueued via calls to the addMessage() method of the FacesContext instance for the
current request, and the valid property on the corresponding component(s) will be set to false."
- Varun
Originally posted by Gregg Bolinger:
Thanks. That makes perfect sense! I can't put this form in the session so I'll just be putting the values in readonly text fields.
Thanks again.
- Varun
Originally posted by K Varun:
Or you may create hidden variables and use them to persist the outputText values.
Henrique Sousa<br />SCJP 1.4<br /> <br />All men die, not all men really live - Braveheart, 1995
One way around that is with JavaScript dealing with the form submit which would enable all disabled inputText before the submit, and disable them again afterwards.
- Varun
Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|