row table editable in the grid with the correct management of the related event.
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@98582 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5637622fc1
commit
1adb58e887
|
@ -753,9 +753,9 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
|
||||
// create the grid with a result list and the column model
|
||||
|
||||
// final EditorGrid<Result> grid = new EditorGrid<Result>(result, cm);
|
||||
final EditorGrid<Result> grid = new EditorGrid<Result>(result, cm);
|
||||
|
||||
final Grid<Result> grid = new Grid<Result>(result, cm);
|
||||
// final Grid<Result> grid = new Grid<Result>(result, cm);
|
||||
|
||||
// grid = new Grid<Result>(result, cm);
|
||||
|
||||
|
@ -775,39 +775,73 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
// grid.getSelectionModel().select(result.getAt(0), true);
|
||||
|
||||
// grid.getSelectionModel().selectAll();
|
||||
|
||||
//listener for row selection in the grid
|
||||
|
||||
grid.getSelectionModel().addSelectionChangedListener(
|
||||
new SelectionChangedListener<Result>() {
|
||||
// grid.getSelectionModel().addSelectionChangedListener(
|
||||
// new SelectionChangedListener<Result>() {
|
||||
//
|
||||
// @Override
|
||||
// public void selectionChanged(
|
||||
// final SelectionChangedEvent<Result> se) {
|
||||
// // TODO Auto-generated method stub
|
||||
//
|
||||
//
|
||||
//
|
||||
// // System.out.println("table slected: " +
|
||||
// // selectedTable);
|
||||
//
|
||||
// // Fire event
|
||||
// eventBus.fireEvent(new SelectedTableEvent());
|
||||
//
|
||||
// tablesLoaded.getButtonById(Dialog.OK)
|
||||
// .addSelectionListener(
|
||||
// new SelectionListener<ButtonEvent>() {
|
||||
//
|
||||
// @Override
|
||||
// public void componentSelected(
|
||||
// ButtonEvent ce) {
|
||||
//
|
||||
// selectedTable = se.getSelectedItem().getValue();
|
||||
//
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// }
|
||||
// });
|
||||
|
||||
@Override
|
||||
public void selectionChanged(
|
||||
final SelectionChangedEvent<Result> se) {
|
||||
// TODO Auto-generated method stub
|
||||
grid.addListener(Events.BeforeEdit, new Listener<GridEvent<Result>>() {
|
||||
|
||||
|
||||
@Override
|
||||
public void handleEvent(final GridEvent<Result> be) {
|
||||
// TODO Auto-generated method stub
|
||||
be.getValue().toString();
|
||||
|
||||
// System.out.println("table selected: " +
|
||||
// be.getValue().toString());
|
||||
|
||||
rootLogger.log(Level.INFO, "table selected: " + be.getValue().toString());
|
||||
|
||||
// Fire event
|
||||
eventBus.fireEvent(new SelectedTableEvent());
|
||||
|
||||
// System.out.println("table slected: " +
|
||||
// selectedTable);
|
||||
tablesLoaded.getButtonById(Dialog.OK)
|
||||
.addSelectionListener(
|
||||
new SelectionListener<ButtonEvent>() {
|
||||
|
||||
// Fire event
|
||||
eventBus.fireEvent(new SelectedTableEvent());
|
||||
@Override
|
||||
public void componentSelected(
|
||||
ButtonEvent ce) {
|
||||
|
||||
selectedTable = be.getValue().toString();
|
||||
|
||||
tablesLoaded.getButtonById(Dialog.OK)
|
||||
.addSelectionListener(
|
||||
new SelectionListener<ButtonEvent>() {
|
||||
|
||||
@Override
|
||||
public void componentSelected(
|
||||
ButtonEvent ce) {
|
||||
|
||||
selectedTable = se.getSelectedItem().getValue();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
grid.addListener(Events.Attach, new Listener<GridEvent<Result>>() {
|
||||
public void handleEvent(GridEvent<Result> be) {
|
||||
|
||||
|
@ -2210,9 +2244,9 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
|
||||
// column2.setSortable(false);
|
||||
|
||||
// TextField<String> textValue = new TextField<String>();
|
||||
// // text.setAllowBlank(false);
|
||||
// column.setEditor(new CellEditor(textValue));
|
||||
TextField<String> textValue = new TextField<String>();
|
||||
// text.setAllowBlank(false);
|
||||
column.setEditor(new CellEditor(textValue));
|
||||
|
||||
configs.add(column);
|
||||
|
||||
|
|
Loading…
Reference in New Issue