Back from little trip from Karachi and today i will show how to delete multiple selected rows from adf table.
In this example i will selected rows using
1) CTRL or SHIFT with mouse click
2) Checkbox at the row
and press Delete button for ease of understanding i created 2 separate buttons in the examples.
Before start i assumed you already setup a Application with EO,VO and AM also using HR Connection
- Add a Transient Attribute to VO of Boolean type named "SelectedRow" We will use this to select row
Here the layout looks like
- Drag a Collection from DataControl as ADF Table to JSF page
- Dont Check RowSelection Checkbox
- Set the table RowSelection property to multiple
- Set EditingMode property to clickToEdit
- Surround your table with af:PanelCollection for look and feel give table a id "myTab"
- Add a toolbar in toolbar facet of Panelcollection
- Add 2 toolbar buttons to your toolbar
- Add partial triggers to your table reference both buttons on toolbar
- Create a backing bean
- Add a RichTable object to your bean with getter and setter methods.
- Set the binding property of the af:table to your Managed Bean
- Add Methods in Backing bean similar to the following code
- Link a method deleteAction to your "Delete Selected Rows" button and DeleteCheckedRows to other button.
Download example for more info
Note: Don't forget to commit your rows after delete :)
- Providing Multiselect capabilities Fusion developer guide
-How to add Transient Checkbox to Table A good example can also be found here
Processing on multi Rows another example from Mr.Steve Muench