I have have icefaces datatable and when user clicks a row, I would like to pass that row's value to another page. The value could row's one column which is the primary key. I am planning to use
How can I do this?
Thanks
*Follow up**
Kindly suggest the approach I am following is the right for passing paramter from my icefaces datatable to another page.
I have the following in jsf page
<h:commandLink actionListener="#{bean.setSelectedItem}">
And in my bean of setSelectedItem(ActionEvent event) method I have the following code
selectedRows.put(dataTable.getRowIndex(), true);
(selectedRows is of Map<Integer, Boolean> selectedRows = new HashMap<Integer, Boolean>();
List<class> selectItems = new ArrayList<class>();
for (int index = 0; index < dataList.size(); index++) {
if (isSelectedRow(index)) {
selectItems.add(dataList.get(index));
}
}
newbean.method(selectItems);
selectItems.clear();
selectedRows.clear();
Correct me if I am doing anthing wrong above.
Thanks
Either bind the table component with
UIData
property in backing beanwith
or bind the table value with
DataModel
property in backing beanwith
Either way, they offer a
getRowData()
method which gives you the row back during bean action method where theUICommand
component is been clicked/pressed.with