-
1. Re: want to get the row key from the extendedDataTable.
ilya_shaikovsky Sep 28, 2009 5:15 AM (in response to jsfgeeks)http://livedemo.exadel.com/richfaces-demo/richfaces/dataTable.jsf?tab=editDataTable not fully the same as you need but idea of getting current row implemented,
-
2. Re: want to get the row key from the extendedDataTable.
jsfgeeks Sep 28, 2009 5:57 AM (in response to jsfgeeks)Hi ilya_shaikovsky,
Thanks for your support. I have seen there, but as I told you I want a backbean code which can help me to get the data of that particular row. Actually I am trying but right now I just can get the row key.
If there is any other way available, then also you can tell me. And if possible, give me a sample code, so that I can better understand.
Thanks again,
Jsf Geeks -
3. Re: want to get the row key from the extendedDataTable.
ilya_shaikovsky Sep 28, 2009 6:00 AM (in response to jsfgeeks)visit a link in my signature. at the page you will find the link to full SVN sources
-
4. Re: want to get the row key from the extendedDataTable.
jsfgeeks Oct 5, 2009 1:43 AM (in response to jsfgeeks)Hi ilya_shaikovsky,
I again appreciate your help. I have seen there, but as a newbie, I am not able to get the thing. So now I am showing my code for the table. I mean what I have done till now.
The table(JSP):<rich:extendedDataTable binding="#{assign_car.table_car_list}" value="#{assign_car.car_list}" var="row" id="table_car_list" style="left: 15px; top: 65px; position: absolute" onRowMouseOver="this.style.backgroundColor='#F1F1F1'" onRowMouseOut="this.style.backgroundColor='#FFFFFF'" width="650px" height="208px" sortMode="Ascending" rows="0"> <f:facet name="header"> <h:outputText value="Assign Car"/> </f:facet> <rich:column id="car_sel" width="190px" style="text-align: center" label="Select Car"> <f:facet name="header"> <h:outputText value="Select Car" /> </f:facet> <h:selectBooleanCheckbox binding="#{assign_car.cb_select_car}" immediate="false" id="cb_select_topic"> <a4j:support event="onchange" immediate="true" action="#{assign_car.value_change_car_selection_cb}"> </a4j:support> </h:selectBooleanCheckbox> </rich:column> <rich:column id="car_name" sortBy="#{row.car}" width="220px" label="Topic"> <f:facet name="header"> <h:outputText value="Car Name" /> </f:facet> <h:outputText id="col_car_name" value="#{row.car}"/> </rich:column> </rich:extendedDataTable> <a4j:commandButton id="btn_add_cars" action="#{assign_car.action_add_cars}" style="width: 70px; left: 15px; top: 282px; position: absolute" value="Add"/>
Backbean:ArrayList<newlist> car_list = new ArrayList<newlist>(); //with it's getter and setter public class newlist{ String c_name; public newlist(String name_of_car){ this.c_name=name_of_car; } public String getC_name() { return c_name; } } // function from which I add cars to list car_list.add(new newlist(rs.getString("car_name"))); // value change event public String value_change_car_selection_cb() { try { System.out.println("\n\t Test Selection made to : "+cb_select_car.getSubmittedValue()); System.out.println("\n\t Row key on which the car is checked or unchecked : "+table_car_list.getActiveRowKey()); } catch(Exception e) { System.out.println("Error in fetching selected cars...\n\t "+e); } } // action event of add button public String action_add_cars() { try { // I don't have anything to write here } catch(Exception e) { System.out.println("Error in assigning cars...\n\t "+e); } return null; }
So, now if you can help me then its great for me.
Thanks for your support,
JSF GEEKS