Re: Handling clicks on CellWidgets
I have the same issue. Did anyone has an answer? On Jan 14, 10:39 pm, Ramon Salla rsal...@gmail.com wrote: I think i maybe found another bug: if @Override public void render(Context context, MyValue data, SafeHtmlBuilder sb) { sb.appendHtmlConstant(button class=\gwt-Button\ testbutton); } Clicking to the button fires a click only on the button if using the improved onBrowserEvent you give me in the former link. But if using a table wrapper: @Override public void render(Context context, MyValue data, SafeHtmlBuilder sb) { sb.appendHtmlConstant(table); sb.appendHtmlConstant(tr); sb.appendHtmlConstant(td); sb.appendHtmlConstant(button class=\gwt-Button\ testbutton); sb.appendHtmlConstant(/td); sb.appendHtmlConstant(/tr); sb.appendHtmlConstant(/table); } Using chrome trace tool I can see that the click event is fired but onBrowserEvent is no even called! using wrapper tables is a must to layout cells while no uibinder is supported. On 7 Gen, 12:05, Ramon Salla rsal...@gmail.com wrote: Thanks Thomas. I used the patched ActionCell and ButtonCell from the link you gave me from the issue and it worked great. Using 2 ActionCells in aCompositeCellalso worked. I think that is all I need to keep cellwidgets in production (users are great bugfinders! ;) ) . I hope the patch will make its way to the next version. Thanks again, Ramon Salla Rovira On 3 Gen, 22:35, Thomas Broyer t.bro...@gmail.com wrote: 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? Seehttp://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;tabletbodytr ... /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=GEGGSC0BEDtd class=GEGGSC0BDC GEGGSC0BFD GEGGSC0BGCdiv 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-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: Handling clicks on CellWidgets
I think i maybe found another bug: if @Override public void render(Context context, MyValue data, SafeHtmlBuilder sb) { sb.appendHtmlConstant(button class=\gwt-Button\ testbutton); } Clicking to the button fires a click only on the button if using the improved onBrowserEvent you give me in the former link. But if using a table wrapper: @Override public void render(Context context, MyValue data, SafeHtmlBuilder sb) { sb.appendHtmlConstant(table); sb.appendHtmlConstant(tr); sb.appendHtmlConstant(td); sb.appendHtmlConstant(button class=\gwt-Button\ testbutton); sb.appendHtmlConstant(/td); sb.appendHtmlConstant(/tr); sb.appendHtmlConstant(/table); } Using chrome trace tool I can see that the click event is fired but onBrowserEvent is no even called! using wrapper tables is a must to layout cells while no uibinder is supported. On 7 Gen, 12:05, Ramon Salla rsal...@gmail.com wrote: Thanks Thomas. I used the patched ActionCell and ButtonCell from the link you gave me from the issue and it worked great. Using 2 ActionCells in a CompositeCell also worked. I think that is all I need to keep cellwidgets in production (users are great bugfinders! ;) ) . I hope the patch will make its way to the next version. Thanks again, Ramon Salla Rovira On 3 Gen, 22:35, Thomas Broyer t.bro...@gmail.com wrote: 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? Seehttp://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;tabletbodytr ... /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=GEGGSC0BEDtd class=GEGGSC0BDC GEGGSC0BFD GEGGSC0BGCdiv 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-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: Handling clicks on CellWidgets
Thanks Thomas. I used the patched ActionCell and ButtonCell from the link you gave me from the issue and it worked great. Using 2 ActionCells in a CompositeCell also worked. I think that is all I need to keep cellwidgets in production (users are great bugfinders! ;) ) . I hope the patch will make its way to the next version. Thanks again, Ramon Salla Rovira On 3 Gen, 22:35, Thomas Broyer t.bro...@gmail.com wrote: 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? Seehttp://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;tabletbodytr ... /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=GEGGSC0BEDtd class=GEGGSC0BDC GEGGSC0BFD GEGGSC0BGCdiv 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.
Handling clicks on CellWidgets
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? 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;tabletbodytr ... /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=GEGGSC0BEDtd class=GEGGSC0BDC GEGGSC0BFD GEGGSC0BGCdiv 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. Question 3 Am I forced to use celltable with different cells for each column. Question 4 How do you managed to distinguish cellclicks if there is only one handler per row in a celltable? I know the questions are not very concise, sorry. Ramon Salla Rovira -- 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.
Re: Handling clicks on CellWidgets
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;tabletbodytr ... /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=GEGGSC0BEDtd class=GEGGSC0BDC GEGGSC0BFD GEGGSC0BGCdiv 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.