I have a listgrid that needs to:
* refresh a toolbar when the selection changes
* show a dialog on double click
So I set up a RecordDoubleClickHandler and SelectionChangedHandler. The latter triggers a data fetch, cause refreshing the toolbar implies fetching some data from server (using a datasource different from the one used by the list grid). The grid has a single row selection mode.
When I double click on a row already selected, it works.
When I double click on a row that was not selected (hence firing a selectionchanged evet) the recorddoubleclick event is not notified.
What's wrong with my code? Using SelectionUpdatedHandler make things worse.
Is there any known workaround?
Here you are a snippet:
I've attached a test case. If needed I can produce a complete standalone test case based on https://github.com/davidecavestro/smartgwt-test-case
Reproduced on SmartGWT 3.0 and its latest nightly build: SmartClient Version: v8.2p_2012-10-16/LGPL Development Only (built 2012-10-16)
* refresh a toolbar when the selection changes
* show a dialog on double click
So I set up a RecordDoubleClickHandler and SelectionChangedHandler. The latter triggers a data fetch, cause refreshing the toolbar implies fetching some data from server (using a datasource different from the one used by the list grid). The grid has a single row selection mode.
When I double click on a row already selected, it works.
When I double click on a row that was not selected (hence firing a selectionchanged evet) the recorddoubleclick event is not notified.
What's wrong with my code? Using SelectionUpdatedHandler make things worse.
Is there any known workaround?
Here you are a snippet:
Code:
...
final ListGrid grid = new ListGrid ();
grid.addRecordDoubleClickHandler (new RecordDoubleClickHandler() {
@Override
public void onRecordDoubleClick (RecordDoubleClickEvent event) {
GWT.log ("double click");
SC.say ("Double click!");//DOES NOT APPEAR DOUBLE-CLICKING ON A UNSELECTED ROW
}
});
grid.addSelectionChangedHandler (new SelectionChangedHandler() {
@Override
public void onSelectionChanged (SelectionEvent event) {
fetchData ();
}
});
...
private void fetchData () {
otherDataSource.invalidateCache ();
otherDataSource.fetchData (new Criteria (), new DSCallback() {
@Override
public void execute (DSResponse response, Object rawData, DSRequest request) {
GWT.log ("data fetched");
}
});
}
Reproduced on SmartGWT 3.0 and its latest nightly build: SmartClient Version: v8.2p_2012-10-16/LGPL Development Only (built 2012-10-16)
Comment