| Author |
passing hidden field value to backing bean
|
amitraj bharat
Greenhorn
Joined: Jul 23, 2008
Posts: 6
|
|
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
Joined: May 19, 2008
Posts: 16
|
|
Hi Amitraj, you can use getRowData() method of datatable to access the selected row values in bean.
|
 |
amitraj bharat
Greenhorn
Joined: Jul 23, 2008
Posts: 6
|
|
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
Joined: Feb 23, 2006
Posts: 14
|
|
|
You can have this hidden field mapped to a property in the backing bean.
|
 |
 |
|
|
subject: passing hidden field value to backing bean
|
|
|