On Monday, January 3, 2011 3:33:37 PM UTC+1, Ramon Salla wrote: > > Hi, Happy new year to all! > > I have some questions regarding cellwidgets. In the showcase > http://gwt.google.com/samples/Showcase/Showcase.html#!CwCellSampler > when clicking the cell which contains the button, it reacts not only > when pressing the button but also when clicking inside the cell but > outside the button. > > First Question, can i avoid this behavior and only reacting to the > button press in a cell? >
See http://code.google.com/p/google-web-toolkit/issues/detail?id=5641 (for now, you'd have to use your own ButtonCell if you want the fixed behavior) > Inspecting the code for this example and the sample from CellList i > see the following: > > From the CellList example, each cell is a div with a single onclick. > > <div onclick="" __idx="0" class="GEGGSC0BI" > style="outline:none;"><table><tbody><tr> ... </tr></tbody></table></ > div> > > From the CellSampler (which uses a cellTable) the onclick is not in > each cell but in each row. > <tr onclick="" class="GEGGSC0BED"><td class="GEGGSC0BDC GEGGSC0BFD > GEGGSC0BGC"><div style="outline:none;"></div></td></tr> > > I tried to use a composite cell with two buttons in a celllist but as > there is only one handler per cell, clicking on any of the two buttons > (and also outside the buttons but inside the cell) reacts with the > same handler. I can't distinguish them. > > Question 2. How can I distinguish clicks inside a cell when using a > cell list. > Try using ActionCell instead of ButtonCell > Question 3 Am I forced to use celltable with different cells for each > column. > You can use the same Cell for several columns. If you want columns though, you have to use CellTable, of make your own Cell widget (not trivial) > Question 4 How do you managed to distinguish cellclicks if there is > only one handler per row in a celltable? > Cell widgets use "event delegation", they register a single event listener but then dispatch accordingly, depending on the exact element targetted by the event (i.e. FieldUpdater for a given Column, onBrowserEvent and ValueUpdater for a given Cell) -- 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-tool...@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.