on 01-06-2005 3:39 PM
Hi,
Does any know how to delete a row from a table view model.
I have a TableViewModel being displayed, when the user select the particular row and click delete i want that particular row to be deleted.
Any Suggestions How.
Thanks,
Emmanuel.
If u want to delete single row, then set the property of TableView - selectionMode="SINGLESELECT". Select the radio button and click on delete button. In the main program, you can get the row value like...
public void onDeleteButtonClicked(Event event) throws PageException {
TableView table = (TableView) this.getComponentByName ("idTableView");
DefaultTableViewModel dmodel = myBean.beanModel;
String pid = "", row_selected;
// Get the first visible row
int firstVisibleRow = table.getVisibleFirstRow();
// Get the last visible row
int lastVisibleRow = table.getVisibleLastRow();
for (int i = firstVisibleRow; i <= lastVisibleRow; i++) {
if (table.isRowSelected(i)) {
row_selected = i;
pid = dmodel.getValueAt(i, 1).toString();
}
}
}
"i" will give you the row no, pid has the value of the row at first column.
Hope this helps.
Thanks,
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you have to find out which row has been clicked, fetch the existing tableviewmodel and remove the row there, and then create a new tableview
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.