Sunday, June 30, 2013

Re: Firing a click event on a CellTable

Hey, Chris

There are surely click event on the cells, but instead of handlers there are field updaters. You may take the example of the Clickable Cell where if you click on the cell its onBrowseEvent gets called which in turn calls the field updater. So the only thing you have to do is override the functionality of the field updater and associate it with the Column of the cell table. 

For your case i think ClickableCell can work as it is or may be you may have to override its functionality to handle Cell Preview Events.

Please revert if you find the info helpful or in case of any issues.

On Friday, 31 May 2013 11:34:10 UTC+5:30, Chris wrote:
Hello,
I am interested in using GWTTestCase to test some features of a view that extends CellTable. In my implementation, I have added a CellPreviewHandler that I would like to check by firing a click event on a cell of the CellTable.  I have tried several methods to no avail. 

My most recent attempt follows:

CellTable<Artist> cellTable = (CellTable<Artist>) view.getDataView();
NativeEvent event = Document.get().createClickEvent(0, 0, 0, 20, 30, false, false, false, false);
DomEvent.fireNativeEvent(event, cellTable);

This does not work.  The CellPreviewHandler doesn't get called.

This has also been tried:

CellTable<Artist> cellTable = (CellTable<Artist>) view.getDataView();
NativeEvent event = Document.get().createClickEvent(0, 0, 0, 0, 0, false, false, false, false);
TableCellElement element = cellTable.getRowElement(2).getCells().getItem(1);
element.dispatchEvent(event);

Same problem as the former. 

TL;DR
Does anyone have insight as to how I can simulate a click event that will fire a CellPreviewEvent on a CellTable for a desired Cell?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment