Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing hidden field value to backing bean

 
amitraj bharat
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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?
 
Anu Sri
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Arshad Sharief
Greenhorn
Posts: 14
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can have this hidden field mapped to a property in the backing bean.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic