• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

passing hidden field value to backing bean

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a Datatable. what I am doin is when a row is clicked. I call javascript function and find the index of the clicked row,set index of the clicked row in hidden field h:inputHidden. Value is getting set in the hidden field.
I have a commandlink on my page with a action.In the action I want this index value which is now in Hidden Field on my JSF . Please can you tell me how to retrieve the hidden field value from jsf page in my backing bean?
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amitraj,

you can use getRowData() method of datatable to access the selected row values in bean.
 
amitraj bharat
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To be more precise I have a normal datatable (no radiobutton. no commandbutton, no commandlink) which displays data. I have a commandlink on the page. On clicking the datatable row the Row is highlighted. After that I click on the commandLink to perform action "edit". Edit action should display the form with the field from datatable row highlighted.

To do this what I have done is on clicking row I call javascript function and get the rowindex. I put this row index value in hidden field using the javascript function. This is working fine. Now I want this value in the hidden field to be submitted to Backing bean on clicking the commandlink.
 
Greenhorn
Posts: 14
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can have this hidden field mapped to a property in the backing bean.
reply
    Bookmark Topic Watch Topic
  • New Topic