Reputation: 2191
I am using JSF 1.2 - My Faces Implementation. I have a form , I use h:inputText to display few values. There are 2 input boxes which should not be edited but shown to the user and should be submitted to the server when the submit it clicked. I tried readonly="true" and disabled="true", both did not solve the purpose! Any suggestions?
Upvotes: 1
Views: 18939
Reputation: 52
Actually, readonly = "true"
doesn't submit value to server, I suggest readonly= "#{facesContext.renderResponse}"
, it works well for me
Upvotes: 1
Reputation: 1108852
The readonly="true"
should suit your requirements. The text will be uneditable and the value will be submitted to the server.
The disabled="true"
don't suit your requirements. The text will indeed be uneditable, but the value won't be submitted to the server.
Note that when you use them both, then the value won't be submitted at all. Also when there's a rendered
attribute on it or one of its parents which evaluates to false
during form submit, then the value won't be gathered during apply request values phase of the form submit request.
Upvotes: 7