Cancel CellList selection

2011-11-09 Thread Yann
Hello, Is there a way to cancel a user selection of a row in a "CellList" ? I can't find something like a "BeforeSelectionHandler" on a "TabLayoutPanel". I would like to be able to prompt a message indicating that the current edited object of the CellList has not been saved if the user clicks on a

Re: Cancel CellList selection

2013-01-29 Thread BM
I was looking something similar and your example is perfect. I am going with approach of having my custom SingleSelectionHandler i.e PromptingSelectionModel . My view is more like GWT Showcase CellList-DetailForm example. If I click on my cell, my code populates the form elements. My Form is a

Re: Cancel CellList selection

2013-01-31 Thread Thomas Broyer
On Tuesday, January 29, 2013 6:43:11 PM UTC+1, BM wrote: > > I was looking something similar and your example is perfect. I am going > with approach of having my custom SingleSelectionHandler > i.e PromptingSelectionModel . My view is more like GWT Showcase > CellList-DetailForm example. If I

Re: Cancel CellList selection

2013-01-31 Thread BM
I tried to use the similar code for PromptingSelectionModel class. It works but the only different is that for unsaved form data, although it prevents the selection of next cell it leaves a mild yellow selection on. So I see blue selection of first cell and mild yellow selection on second cell.

Re: Cancel CellList selection

2013-01-31 Thread BM
Thanks Thomas. Unfortunately we are not using any DI framework. So we are going by traditional GWT Activities and Places framework with ClientFactory being passed to my Activity from AppActivityMapper. Interesting. I never thought declaration of SingleSelectionModel model should be in Activity

Re: Cancel CellList selection

2013-01-31 Thread BM
I also realized that the overriden setSelected method is called two times in PromptingSelectionModel. So if I selected Cell 7 and Cell 7 is currently selected and if I click on Cell 10, the the cell selection is about to changed the first call to overriden setSelected method passes Cell 7 object

Re: Cancel CellList selection

2011-11-09 Thread Thomas Broyer
Try with a custom CellPreviewEvent.Handler; possibly delegating to a DefaultSelectionEventManager for the default behavior. -- You received this message because you are sub

Re: Cancel CellList selection

2011-11-10 Thread Yann
Hello Thomas, Thanks a lot for your response but what do you mean by "Try with a custom CellPreviewEvent.Handler". I tried : myCellList.addCellPreviewHandler(new CellPreviewEvent.Handler(){ @Override public void onCellPreview(CellPreviewEvent in_event){ System.out

Re: Cancel CellList selection

2011-11-10 Thread Yann
Apologies Thomas, "onCellPreview" is actually called ! I didn't find yet which native event I should cancel, but I'm working on it... -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@g

Re: Cancel CellList selection

2011-11-10 Thread Thomas Broyer
It's not about cancelling the event; it's about *not* routing it to a DefaultSelectionEventManager (which changes selection depending on the event). It also means you shouldn't addCellPreviewHandler, but instead use the two-argument overload of setSelectionModel

Re: Cancel CellList selection

2011-11-10 Thread Yann
Thomas, Overriding SingleSelectionModel.setSelected() works like a charm. It's so obvious I really should have figured it by myself... Thanks a lot ! -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to goo