Friday, February 26, 2016

Re: Cell Browser External Listener

Hello Jens,

Thanks for your help.  I managed to add
cellBrowser.addDomHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
GWT.log("DownloadPanel.onClick "+clickEvent.getNativeEvent().toString());
}
}, ClickEvent.getType());

But that doesn't get me the domain / model data I need (logical event data I guess).  So i ended up being a bit hacky and firing event from within the Cell
TreeViewModelListener listenerObj = (TreeViewModelListener) listeners.get(i);
DownloadSelectedEvent downloadSelectedEvent = new DownloadSelectedEvent(param1, param2, param3...);
listenerObj.onDownloadSelected(downloadSelectedEvent);

and implemented listener interface and implemented

public void onDownloadSelected(DownloadSelectedEvent event){}
well it worked :]
Regards, Sam




On 26 February 2016 at 13:38, Jens <jens.nehlmeier@gmail.com> wrote:
Since "click" is a browser event you would need to use addDomHandler() instead of addHandler().

If that does not work either then I would let the Cell publish a custom Event on the EventBus. Maybe using custom events via EventBus is more readable anyways.

-- J.

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/6eUspwFcq0g/unsubscribe.
To unsubscribe from this group and all its topics, 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GWT Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment