• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to get the value from the readonly field?????

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,

can anyone know how to get the value from readonly field in jsf???.

i am getting null.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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???
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic