Thursday, May 30, 2013

Firing a click event on a CellTable

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate