How to handle double click/enter key on the row of a datagrid ?

2012-10-18 Thread Marius Grama
I have a scenario where i am working with a GWT DataGrid on which when the user makes a double-click an event should be raised containing the information about the model bean of the selected selected row. e.g : For a DataGrid containing informations about persons (columns: first name , last

Re: How to handle double click/enter key on the row of a datagrid ?

2012-10-18 Thread Marius Grama
My (dirty) workaround was extending AbstractCell class and adding the custom code within: @Override public void onBrowserEvent(final Context context, final Element parent, final C value, final NativeEvent event, final ValueUpdaterC valueUpdater) { HasDataT

Re: How to handle double click/enter key on the row of a datagrid ?

2012-10-18 Thread Jens
If you want to do this outside the Datagrid you can use DataGrid.addCellPreviewHandler(). The event contains all the information you need. And it is SelectionModel? super T because its less restrictive. For example you can have a DataGridInteger that holds a more generic SelectionModelNumber.

Re: How to handle double click/enter key on the row of a datagrid ?

2012-10-18 Thread Marius Grama
Thanks Jens for the tip. For anybody interested on the solution I've implemented it in the following manner : addCellPreviewHandler(new CellPreviewEvent.HandlerT() { @Override public void onCellPreview(final CellPreviewEventT event) { //