| Author |
how to get the value from the readonly field?????
|
gopal kishan
Ranch Hand
Joined: Feb 23, 2005
Posts: 99
|
|
Hi All, I have a readonly field in JSF. in action class i want to get the value of that field. How to get the readonly field value??? i am getting null if the field is readonly. i am getting value if the field is not readonly.
|
 |
gopal kishan
Ranch Hand
Joined: Feb 23, 2005
Posts: 99
|
|
hi all, can anyone know how to get the value from readonly field in jsf???. i am getting null.
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15229
|
|
|
Do you mean readonly as in readonly="true" or do you mean disabled components? Disabled components don't get their values submitted with the form.
|
 |
gopal kishan
Ranch Hand
Joined: Feb 23, 2005
Posts: 99
|
|
HI, Thanks for reply. Actually i have a date field and have a button. when the user click the button it opens a calendar and set date in that field. i want to set that date field as readonly and i need to get that date value when the user submit the form. how to do this???
|
 |
rahul sinha
Greenhorn
Joined: Feb 17, 2006
Posts: 7
|
|
Even I had the same problem in my previous project. But I want to ask why you want to make date field readonly? I feel one should also allow input field editable , so that user can enter date directly than doing clicking button always. For your question according to my knowledge you cannot get value in BB for a ReadOnly field in JSF. Please let me know if you get the solution.
|
 |
gopal kishan
Ranch Hand
Joined: Feb 23, 2005
Posts: 99
|
|
Hi Rahul, yes, you are correct , if the field is readonly then we cant get the value in backing bean of JSF. so what i did was i used <f:convertDateTime> and i wrote validation method to check the format of the date in my backing bean. so anyway user can enter the date , if he enter wrong date then it will throw conversion error, if he enters wrong format then my validator method will fire. to display the message i am using <h:message> thanks Gopal
|
 |
 |
|
|
subject: how to get the value from the readonly field?????
|
|
|