on 12-21-2004 11:45 AM
Hi,
very new to EP and I Was working on tableviews where had mentioned the onRowSelection event can anyone tell me how to work with this event and also how to get data of the selected row, i need to know this very badly, so plz can anyone help.
Hi!
There are some good examples in EP(User Interface Development->HTMLB->Additional Examples using Models->tableView).
I think you could do something like that:
public void onMyOnRowSelection(Event event) throws PageException {
TableRowSelectionEvent r = (TableRowSelectionEvent)event;
int realSelectedRow = r.getVisibleRowIndex() + Integer.parseInt(myBean.getVisibleRow()) - 1;
String valueForCol1 = myBean.getModel().getValueAt(realSelectedRow, 1).toString();
}
"myBean" is your TableViewBean. There you can set the visible at the NavigationEvents... you can see this in the examples...
Best Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you have to define the method, which will be started, when the event occured:
myTableView.setOnRowSelection("onRowSelection");
In the Main-Class you have to implement this method like:
public void onRowSelection (Event event) {
TableView table = (TableView) this.getComponentByName("myTableView");
}
Regards,
Gerhard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I implemented this a long time ago so I'll do my best:
TableView table = (TableView) this.getComponentByName("backenTV");
int ns = 0;
for (int i = 1; i <= table.getRowCount(); i++) {
if ((table.isRowSelected(i))) {
ns = i;
}
}
After this You can read out the line of the TableViewModel an access the values.
Good luck and try it.
Walter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
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.