Re: Celltable w/ selectionModel and ActionCells
this sounds great, John! i'll give it a try. Thanks! On Mar 2, 8:00 am, John LaBanca wrote: > r9788 adds a new BlacklistEventTranslator and WhitelistEventTranslator for > use in DefaultSelectionEventManager. Using these, you can disable/enable > selection for specific > columns.http://code.google.com/p/google-web-toolkit/source/detail?r=9788 > > DefaultSelectionEventManager manager = > DefaultSelectionEventManager.createBlacklistManager(0, > 3); // Ignore clicks on columns 0 and 3 > SelectionModel model = new SingleSelectionModel(); > cellTable.setSelectionModel(model, manager); > > Hope this helps with this issue. You can wait for GWT 2.3, or just copy the > BlacklistEventTranslator code into your app and call > DefaultSelectionEventManager.createCustomManager(myBlacklistEventTranslator). > > Thanks, > John LaBanca > jlaba...@google.com > > On Tue, Feb 22, 2011 at 12:09 PM, John LaBanca wrote: > > You can try overriding ActionCell#handlesSelection() to return true to > > disable the default selection. We might need to do so for all interactive > > cells and change the JavaDoc of Cell#handlesSelection() to clarify that it > > can be used to simply disable default selection. But in general, this is > > what handlesSelection() was designed to do. > > > Thanks, > > John LaBanca > > jlaba...@google.com > > > On Tue, Feb 22, 2011 at 8:44 AM, Thomas Visser > > wrote: > > >> ActionCell already returns false for handlesSelection(). If a cell > >> declares to handle the selection, the default way of (de)selecting, by > >> clicking in the row, does not work anymore. Then it is the value- > >> updater's task to do so. I recently wrote something about it in a blog > >> post. See for more information: > >>http://thoughtsofthree.com/2011/02/creating-a-gwt-radiobuttoncell/ > >> (paragraph "Depending on and handling the selection") > > >> On Feb 22, 5:30 am, Patrick Tucker wrote: > >> > I haven't played with this a whole bunch but have you looked at > >> > handlesSelection? I was under the impression that by setting this to > >> > false you indicate that a particular cell type is not allowed to > >> > determine selection state? > > >> > Like if you have a checkboxcell it can be the only cell that > >> > determines whether or not the row is selected. > > >> > On Feb 11, 2:09 pm, "Henry H." wrote: > > >> > > yeah, i had the feeling i have to ditch the selectionModel. > >> > > thanks for your help... > > >> > > On Feb 11, 6:28 am, Thomas Visser wrote: > > >> > > > This is not possible. In your case, the click event is always also > >> > > > given to the SelectionModel. > > >> > > > See line 971 in CellTable (http://www.google.com/codesearch/p? > >> > > > hl=en#A1edwVHBClQ/user/src/com/google/gwt/user/cellview/client/ > >> > > > CellTable.java&q=CellTable%20package:http://google-web-toolkit > >> > > > %5C.googlecode%5C.com&sa=N&cd=1&ct=rc): > > >> > > > if (selectionModel != null && "click".equals(eventType) && ! > >> > > > handlesSelection) { > >> > > > selectionModel.setSelected(value, true); > > >> > > > } > > >> > > > As you can see, if you could make the handlesSelection boolean true, > >> > > > the selectionModel will not be updated. This boolean is true if one > >> > > > (or more) cell(s) declare(s) to handle the selection. ActionCell > >> does > >> > > > not do that. What you can do is create your own cell, make it handle > >> > > > the selection, and use it for all the columns that you want to be > >> > > > clickable. > > >> > > > On Feb 11, 1:42 am, "Henry H." wrote: > > >> > > > > hi, > >> > > > > i have a celltable with a selectionModel but also a column of > >> > > > > actioncells. > >> > > > > the selectionModel and actioncells both handle click events, but > >> when > >> > > > > i click the action cell, it also triggers the selectionmodel click > >> > > > > handler. > >> > > > > is it possible to prevent this? Or do i have to nix the > >> selectionModel > >> > > > > and go with clickable cells on the row? > > >> > > > > thanks. > > >> -- > >> 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@googlegroups.com. > >> To unsubscribe from this group, send email to > >> google-web-toolkit+unsubscr...@googlegroups.com. > >> For more options, visit this group at > >>http://groups.google.com/group/google-web-toolkit?hl=en. -- 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@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable w/ selectionModel and ActionCells
r9788 adds a new BlacklistEventTranslator and WhitelistEventTranslator for use in DefaultSelectionEventManager. Using these, you can disable/enable selection for specific columns. http://code.google.com/p/google-web-toolkit/source/detail?r=9788 DefaultSelectionEventManager manager = DefaultSelectionEventManager.createBlacklistManager(0, 3); // Ignore clicks on columns 0 and 3 SelectionModel model = new SingleSelectionModel(); cellTable.setSelectionModel(model, manager); Hope this helps with this issue. You can wait for GWT 2.3, or just copy the BlacklistEventTranslator code into your app and call DefaultSelectionEventManager.createCustomManager(myBlacklistEventTranslator). Thanks, John LaBanca jlaba...@google.com On Tue, Feb 22, 2011 at 12:09 PM, John LaBanca wrote: > You can try overriding ActionCell#handlesSelection() to return true to > disable the default selection. We might need to do so for all interactive > cells and change the JavaDoc of Cell#handlesSelection() to clarify that it > can be used to simply disable default selection. But in general, this is > what handlesSelection() was designed to do. > > Thanks, > John LaBanca > jlaba...@google.com > > > > On Tue, Feb 22, 2011 at 8:44 AM, Thomas Visser wrote: > >> ActionCell already returns false for handlesSelection(). If a cell >> declares to handle the selection, the default way of (de)selecting, by >> clicking in the row, does not work anymore. Then it is the value- >> updater's task to do so. I recently wrote something about it in a blog >> post. See for more information: >> http://thoughtsofthree.com/2011/02/creating-a-gwt-radiobuttoncell/ >> (paragraph "Depending on and handling the selection") >> >> On Feb 22, 5:30 am, Patrick Tucker wrote: >> > I haven't played with this a whole bunch but have you looked at >> > handlesSelection? I was under the impression that by setting this to >> > false you indicate that a particular cell type is not allowed to >> > determine selection state? >> > >> > Like if you have a checkboxcell it can be the only cell that >> > determines whether or not the row is selected. >> > >> > On Feb 11, 2:09 pm, "Henry H." wrote: >> > >> > >> > >> > >> > >> > >> > >> > > yeah, i had the feeling i have to ditch the selectionModel. >> > > thanks for your help... >> > >> > > On Feb 11, 6:28 am, Thomas Visser wrote: >> > >> > > > This is not possible. In your case, the click event is always also >> > > > given to the SelectionModel. >> > >> > > > See line 971 in CellTable (http://www.google.com/codesearch/p? >> > > > hl=en#A1edwVHBClQ/user/src/com/google/gwt/user/cellview/client/ >> > > > CellTable.java&q=CellTable%20package:http://google-web-toolkit >> > > > %5C.googlecode%5C.com&sa=N&cd=1&ct=rc): >> > >> > > > if (selectionModel != null && "click".equals(eventType) && ! >> > > > handlesSelection) { >> > > > selectionModel.setSelected(value, true); >> > >> > > > } >> > >> > > > As you can see, if you could make the handlesSelection boolean true, >> > > > the selectionModel will not be updated. This boolean is true if one >> > > > (or more) cell(s) declare(s) to handle the selection. ActionCell >> does >> > > > not do that. What you can do is create your own cell, make it handle >> > > > the selection, and use it for all the columns that you want to be >> > > > clickable. >> > >> > > > On Feb 11, 1:42 am, "Henry H." wrote: >> > >> > > > > hi, >> > > > > i have a celltable with a selectionModel but also a column of >> > > > > actioncells. >> > > > > the selectionModel and actioncells both handle click events, but >> when >> > > > > i click the action cell, it also triggers the selectionmodel click >> > > > > handler. >> > > > > is it possible to prevent this? Or do i have to nix the >> selectionModel >> > > > > and go with clickable cells on the row? >> > >> > > > > thanks. >> >> -- >> 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@googlegroups.com. >> To unsubscribe from this group, send email to >> google-web-toolkit+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/google-web-toolkit?hl=en. >> >> > -- 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@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable w/ selectionModel and ActionCells
You can try overriding ActionCell#handlesSelection() to return true to disable the default selection. We might need to do so for all interactive cells and change the JavaDoc of Cell#handlesSelection() to clarify that it can be used to simply disable default selection. But in general, this is what handlesSelection() was designed to do. Thanks, John LaBanca jlaba...@google.com On Tue, Feb 22, 2011 at 8:44 AM, Thomas Visser wrote: > ActionCell already returns false for handlesSelection(). If a cell > declares to handle the selection, the default way of (de)selecting, by > clicking in the row, does not work anymore. Then it is the value- > updater's task to do so. I recently wrote something about it in a blog > post. See for more information: > http://thoughtsofthree.com/2011/02/creating-a-gwt-radiobuttoncell/ > (paragraph "Depending on and handling the selection") > > On Feb 22, 5:30 am, Patrick Tucker wrote: > > I haven't played with this a whole bunch but have you looked at > > handlesSelection? I was under the impression that by setting this to > > false you indicate that a particular cell type is not allowed to > > determine selection state? > > > > Like if you have a checkboxcell it can be the only cell that > > determines whether or not the row is selected. > > > > On Feb 11, 2:09 pm, "Henry H." wrote: > > > > > > > > > > > > > > > > > yeah, i had the feeling i have to ditch the selectionModel. > > > thanks for your help... > > > > > On Feb 11, 6:28 am, Thomas Visser wrote: > > > > > > This is not possible. In your case, the click event is always also > > > > given to the SelectionModel. > > > > > > See line 971 in CellTable (http://www.google.com/codesearch/p? > > > > hl=en#A1edwVHBClQ/user/src/com/google/gwt/user/cellview/client/ > > > > CellTable.java&q=CellTable%20package:http://google-web-toolkit > > > > %5C.googlecode%5C.com&sa=N&cd=1&ct=rc): > > > > > > if (selectionModel != null && "click".equals(eventType) && ! > > > > handlesSelection) { > > > > selectionModel.setSelected(value, true); > > > > > > } > > > > > > As you can see, if you could make the handlesSelection boolean true, > > > > the selectionModel will not be updated. This boolean is true if one > > > > (or more) cell(s) declare(s) to handle the selection. ActionCell does > > > > not do that. What you can do is create your own cell, make it handle > > > > the selection, and use it for all the columns that you want to be > > > > clickable. > > > > > > On Feb 11, 1:42 am, "Henry H." wrote: > > > > > > > hi, > > > > > i have a celltable with a selectionModel but also a column of > > > > > actioncells. > > > > > the selectionModel and actioncells both handle click events, but > when > > > > > i click the action cell, it also triggers the selectionmodel click > > > > > handler. > > > > > is it possible to prevent this? Or do i have to nix the > selectionModel > > > > > and go with clickable cells on the row? > > > > > > > thanks. > > -- > 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@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- 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@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable w/ selectionModel and ActionCells
ActionCell already returns false for handlesSelection(). If a cell declares to handle the selection, the default way of (de)selecting, by clicking in the row, does not work anymore. Then it is the value- updater's task to do so. I recently wrote something about it in a blog post. See for more information: http://thoughtsofthree.com/2011/02/creating-a-gwt-radiobuttoncell/ (paragraph "Depending on and handling the selection") On Feb 22, 5:30 am, Patrick Tucker wrote: > I haven't played with this a whole bunch but have you looked at > handlesSelection? I was under the impression that by setting this to > false you indicate that a particular cell type is not allowed to > determine selection state? > > Like if you have a checkboxcell it can be the only cell that > determines whether or not the row is selected. > > On Feb 11, 2:09 pm, "Henry H." wrote: > > > > > > > > > yeah, i had the feeling i have to ditch the selectionModel. > > thanks for your help... > > > On Feb 11, 6:28 am, Thomas Visser wrote: > > > > This is not possible. In your case, the click event is always also > > > given to the SelectionModel. > > > > See line 971 in CellTable (http://www.google.com/codesearch/p? > > > hl=en#A1edwVHBClQ/user/src/com/google/gwt/user/cellview/client/ > > > CellTable.java&q=CellTable%20package:http://google-web-toolkit > > > %5C.googlecode%5C.com&sa=N&cd=1&ct=rc): > > > > if (selectionModel != null && "click".equals(eventType) && ! > > > handlesSelection) { > > > selectionModel.setSelected(value, true); > > > > } > > > > As you can see, if you could make the handlesSelection boolean true, > > > the selectionModel will not be updated. This boolean is true if one > > > (or more) cell(s) declare(s) to handle the selection. ActionCell does > > > not do that. What you can do is create your own cell, make it handle > > > the selection, and use it for all the columns that you want to be > > > clickable. > > > > On Feb 11, 1:42 am, "Henry H." wrote: > > > > > hi, > > > > i have a celltable with a selectionModel but also a column of > > > > actioncells. > > > > the selectionModel and actioncells both handle click events, but when > > > > i click the action cell, it also triggers the selectionmodel click > > > > handler. > > > > is it possible to prevent this? Or do i have to nix the selectionModel > > > > and go with clickable cells on the row? > > > > > thanks. -- 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@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable w/ selectionModel and ActionCells
I haven't played with this a whole bunch but have you looked at handlesSelection? I was under the impression that by setting this to false you indicate that a particular cell type is not allowed to determine selection state? Like if you have a checkboxcell it can be the only cell that determines whether or not the row is selected. On Feb 11, 2:09 pm, "Henry H." wrote: > yeah, i had the feeling i have to ditch the selectionModel. > thanks for your help... > > On Feb 11, 6:28 am, Thomas Visser wrote: > > > > > > > > > This is not possible. In your case, the click event is always also > > given to the SelectionModel. > > > See line 971 in CellTable (http://www.google.com/codesearch/p? > > hl=en#A1edwVHBClQ/user/src/com/google/gwt/user/cellview/client/ > > CellTable.java&q=CellTable%20package:http://google-web-toolkit > > %5C.googlecode%5C.com&sa=N&cd=1&ct=rc): > > > if (selectionModel != null && "click".equals(eventType) && ! > > handlesSelection) { > > selectionModel.setSelected(value, true); > > > } > > > As you can see, if you could make the handlesSelection boolean true, > > the selectionModel will not be updated. This boolean is true if one > > (or more) cell(s) declare(s) to handle the selection. ActionCell does > > not do that. What you can do is create your own cell, make it handle > > the selection, and use it for all the columns that you want to be > > clickable. > > > On Feb 11, 1:42 am, "Henry H." wrote: > > > > hi, > > > i have a celltable with a selectionModel but also a column of > > > actioncells. > > > the selectionModel and actioncells both handle click events, but when > > > i click the action cell, it also triggers the selectionmodel click > > > handler. > > > is it possible to prevent this? Or do i have to nix the selectionModel > > > and go with clickable cells on the row? > > > > thanks. -- 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@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable w/ selectionModel and ActionCells
yeah, i had the feeling i have to ditch the selectionModel. thanks for your help... On Feb 11, 6:28 am, Thomas Visser wrote: > This is not possible. In your case, the click event is always also > given to the SelectionModel. > > See line 971 in CellTable (http://www.google.com/codesearch/p? > hl=en#A1edwVHBClQ/user/src/com/google/gwt/user/cellview/client/ > CellTable.java&q=CellTable%20package:http://google-web-toolkit > %5C.googlecode%5C.com&sa=N&cd=1&ct=rc): > > if (selectionModel != null && "click".equals(eventType) && ! > handlesSelection) { > selectionModel.setSelected(value, true); > > } > > As you can see, if you could make the handlesSelection boolean true, > the selectionModel will not be updated. This boolean is true if one > (or more) cell(s) declare(s) to handle the selection. ActionCell does > not do that. What you can do is create your own cell, make it handle > the selection, and use it for all the columns that you want to be > clickable. > > On Feb 11, 1:42 am, "Henry H." wrote: > > > hi, > > i have a celltable with a selectionModel but also a column of > > actioncells. > > the selectionModel and actioncells both handle click events, but when > > i click the action cell, it also triggers the selectionmodel click > > handler. > > is it possible to prevent this? Or do i have to nix the selectionModel > > and go with clickable cells on the row? > > > thanks. -- 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@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable w/ selectionModel and ActionCells
This is not possible. In your case, the click event is always also given to the SelectionModel. See line 971 in CellTable (http://www.google.com/codesearch/p? hl=en#A1edwVHBClQ/user/src/com/google/gwt/user/cellview/client/ CellTable.java&q=CellTable%20package:http://google-web-toolkit %5C.googlecode%5C.com&sa=N&cd=1&ct=rc): if (selectionModel != null && "click".equals(eventType) && ! handlesSelection) { selectionModel.setSelected(value, true); } As you can see, if you could make the handlesSelection boolean true, the selectionModel will not be updated. This boolean is true if one (or more) cell(s) declare(s) to handle the selection. ActionCell does not do that. What you can do is create your own cell, make it handle the selection, and use it for all the columns that you want to be clickable. On Feb 11, 1:42 am, "Henry H." wrote: > hi, > i have a celltable with a selectionModel but also a column of > actioncells. > the selectionModel and actioncells both handle click events, but when > i click the action cell, it also triggers the selectionmodel click > handler. > is it possible to prevent this? Or do i have to nix the selectionModel > and go with clickable cells on the row? > > thanks. -- 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@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Celltable w/ selectionModel and ActionCells
hi, i have a celltable with a selectionModel but also a column of actioncells. the selectionModel and actioncells both handle click events, but when i click the action cell, it also triggers the selectionmodel click handler. is it possible to prevent this? Or do i have to nix the selectionModel and go with clickable cells on the row? thanks. -- 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@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.