-
1. Re: How to find out, which Row was clicked in a DataTable?
lmk Jan 22, 2008 3:32 AM (in response to flokati)helloo
I do something like this:<rich:dataTable cellpadding="0" cellspacing="0" border="0" var="list" ..> <a4j:support event="onRowDblClick" reRender="details" action="#{queryManager.getSelected}" oncomplete="javascript:Richfaces.showModalPanel('_panel',{left:'auto', top:'auto'})" />
<a4j:support event="onRowDblClick" action="#{bean.getSelectedRow}" /> <rich:column> </rich:column>
on the backing bean actionMyBean bean = (MyBean) FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("list");
-
2. Re: How to find out, which Row was clicked in a DataTable?
flokati Jan 23, 2008 9:29 AM (in response to flokati)Works fine, thank you!
-
3. Re: How to find out, which Row was clicked in a DataTable?
aish Feb 6, 2008 8:12 AM (in response to flokati)Hi,
I have a similar situation. I have to display the list of rows from a table using dataTable. I am also using dataScroller to provide pagination option as there is a long list of rows and pagination would be easier.
Depending on the row selected from the above table, the second table should be displayed.
My code is as follows:
<rich:dataTable value="#{TableDetail.dissummarytbl}"
var="category" rowKeyVar="rkv" rowkey="#{rowkey}"
onRowClick="RowClick()" rows="5" binding="#{TableDetail.hseldataTable}">
<rich:column>
</rich:column>
.
.
.
<rich:datascroller pageIndexVar="1" pagesVar="5">
</rich:datascroller>
</rich:dataTable>
Hidden commandButton to trigger row selection with the help of JS
==============================
<a4j:commandButton id="cmdButton" value=" " reRender="table" style="width:0px;height:0px"
action="#{TableDetail.takeSelection}" immediate="true">
This is the second table
================
<rich:dataTable value="#{TableDetail.selectedRecDetails}" var="sel" id="table">
</rich:dataTable>
The takeSelection method in my backing bean is as follows:
public void takeSelection()
{
Object rowdata = this.getHseldataTable().getRowData();
this.selectedRecs.add((Summary) rowdata);
}
== private HtmlDataTable hseldataTable; (There is a getter and setter for this hseldataTable)
The takeSelection method is not working. It is throwing illegalArguementException and not working.
Can you please pass on your suggestions?
Your help is greatly appreciated as I am new to JSF and developing my first JSF application.
Thanks
Aish