Saturday, June 29, 2013

Re: Firing a click event on a CellTable

similar case:



protected CellList contactList;


    contactList.addDomHandler(new ContextMenuHandler() {
        public void onContextMenu(ContextMenuEvent evt) {
        final NativeEvent event = evt.getNativeEvent();

        final NativeEvent newEvent = Document.get().createClickEvent(-1,
            event.getScreenX(), event.getScreenY(), event.getClientX(), event.getClientY(),
            event.getCtrlKey(), event.getAltKey(), event.getShiftKey(), event.getMetaKey());


    }, ContextMenuEvent.getType());

But :  contactList.getElement().dispatchEvent(newEvent);
instead of : DOM.eventGetTarget(;
- not working...

So, i think, you correctly create native event, but you send them to incorrect target.

пятница, 31 мая 2013 г., 12:04:10 UTC+6 пользователь Chris написал:
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);

Same problem as the former. 

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
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment