public void onBrowserEvent(Context context, Element parent, Track value, NativeEvent event, ValueUpdater<Track> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
if ("click".equals(event.getType())) {
EventTarget eventTarget = event.getEventTarget();
GWT.log("You selected " + value.getName() + " by " + value.getArtist());
}
}
CellBrowser cellBrowser = cbb.build();
cellBrowser.addHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
}
});
But it appears not. What and how is the best way to externally listen to CellBrowser and Cell events, so that I can display the event info "outside" in another e.g. Panel?
Regards, Sam
cellBrowser.addDomHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
GWT.log("DownloadPanel.onClick "+clickEvent.getNativeEvent().toString());
}
}, ClickEvent.getType());
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
--
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-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Hello Jens,Thanks for your help. I managed to addcellBrowser.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 CellTreeViewModelListener 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.ne...@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+unsub...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.