aspose file tools*
The moose likes JSF and the fly likes passing hidden field value to backing bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "passing hidden field value to backing bean" Watch "passing hidden field value to backing bean" New topic
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing hidden field value to backing bean