-
1. Re: Unable to catch selected line in a scrollableDataTable
ptr83 Jul 17, 2008 6:23 AM (in response to ptr83)Nobody has an idea... ?
Thanks -
2. Re: Unable to catch selected line in a scrollableDataTable
ptr83 Jul 22, 2008 4:44 AM (in response to ptr83)I'm still searching... :-/
-
3. Re: Unable to catch selected line in a scrollableDataTable
ilya_shaikovsky Jul 22, 2008 6:36 AM (in response to ptr83)Just download demo full sources and run it.
-
4. Re: Unable to catch selected line in a scrollableDataTable
smutzski Jan 29, 2009 4:01 AM (in response to ptr83)"ilya_shaikovsky" wrote:
Just download demo full sources and run it.
Where can you download that?
Mine isn't working too.. same problem as above, selection doesn't work.
Someone has the answer to fix this problem? :) -
5. Re: Unable to catch selected line in a scrollableDataTable
smutzski Jan 29, 2009 4:02 AM (in response to ptr83)BTW, mine is a ExtendedDatatable.. but that isn't a problem, is it? :)
-
6. Re: Unable to catch selected line in a scrollableDataTable
dxxvi Jan 29, 2009 5:52 AM (in response to ptr83)not sure about the 3.2.1.GA version, but in 3.3.0.GA you can do something like this:
- jsf bean:public class Bean { private HtmlExtendedDataTable dataTable; private Selection selection; public void selectRow() { Iterator<Object> iterator = selection.keys() (or getKeys() I don't remember); if (iterator.hasNext()) { dataTable.setRowKey(iterator.next()); Car selectedCar = (Car) dataTable.getRowData(); }
- xhtml page:<rich:extendedDataTable value="#{bean.cars}" var="car" binding="#{bean.dataTable}" selection="#{bean.selection}" selectionMode="single"> <a4j:support event="onselectionchange" action="#{bean.selectRow}" reRender="something" oncomplete="maybe show a popup"/> <rich:column ... </rich:extendedDataTable>
Hope that helps. -
7. Re: Unable to catch selected line in a scrollableDataTable
smutzski Jan 29, 2009 6:09 AM (in response to ptr83)Iterator iterator = selection.getKeys();
This is given me a NullPointException.
My code now is:public void selectRow() { if (selectedUsers == null) { System.out.println("No data in selectedUsers"); } else { selectedUsers.clear(); System.out.println("Data in selectedUsers deleted"); } Iterator<Object> iterator = selection.getKeys(); if (iterator.hasNext()) { table.setRowKey(iterator.next()); User selectedUser = (User) table.getRowData(); selectedUsers.add(selectedUser); } }
Selection selection; private ArrayList<User> selectedUsers;
-
8. Re: Unable to catch selected line in a scrollableDataTable
smutzski Jan 29, 2009 6:53 AM (in response to ptr83)When i use the method to click @ row and then do the selection method, it works... but when i use a button, then it doesn't work... ???
-
9. Re: Unable to catch selected line in a scrollableDataTable
smutzski Jan 29, 2009 6:57 AM (in response to ptr83)"smutzski" wrote:
When i use the method to click @ row and then do the selection method, it works... but when i use a button, then it doesn't work... ???
I mean this one:<a4j:support event="onselectionchange" action="#{Datatable.selectRow}" oncomplete="javascript:Richfaces.showModalPanel('panel');"/>
-
10. Re: Unable to catch selected line in a scrollableDataTable
smutzski Jan 29, 2009 7:14 AM (in response to ptr83)But now my 'SelectedUsers" aren't updated... the one i selected the first time is showed, and not the one that really is selected... :|
-
11. Re: Unable to catch selected line in a scrollableDataTable
smutzski Jan 29, 2009 7:26 AM (in response to ptr83)Oke, nevermind.. it works now! :D
-
12. Re: Unable to catch selected line in a scrollableDataTable
sebekk23 Jan 30, 2009 1:38 AM (in response to ptr83)So if You made this, share Your solution with us ;)
-
13. Re: Unable to catch selected line in a scrollableDataTable
smutzski Jan 30, 2009 2:14 AM (in response to ptr83)I will, but i don't have time to do it now.. about 2 hours i have my presentation about my internship and it's difficult... so, if i have time i'll share. :)