2

I have an application, that uses the MultiSelectionModel, and it works great, but I need the site I'm developing to work on mobile devices, and so I can't use the keyboard to assist in selecting the elements (since it doesn't exist). EX: On the desktop I just hold ctrl and click on all the element that I want to select.

So on the mobile device, I would like to modify the default behavior of the MultiSelectionModel so that when you click on a CellList item, it toggles the selection state of that item.

I have looked through the source for it and cannot see anyway to implement the behavior that I need. (Mobile MultiSelection).

napo
  • 85
  • 1
  • 7

2 Answers2

5

Whether you add a checkbox column or not, you'll have to add a cell preview handler. The easiest way to define one is to use DefaultSelectionEventManager, either using a checkbox manager in combination with a checkbox column, or creating a custom one (you'd map a click event into a toggle action).

You can see it used, the checkbox variant, in the GWT Showcase; it uses the setSelectionModel overload with two arguments to add the CellPreviewEvent.Handler at the same time.

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • Thanks for the info, I needed to use a CellList, so I brewed up the multi-selection functionality I needed from a SingleSelectionHandler. – napo Jul 28 '11 at 19:06
  • 1
    Hey napo, I'm looking to implement toggle-on-click functionality with a CellList (not CellTable) also, can you share your solution? – Nick Siderakis Oct 27 '11 at 16:10
0

Just adding an extra checkbox column would be a more user friendly solution.

maneesh
  • 1,692
  • 1
  • 14
  • 18