Friday, February 26, 2016

Cell Browser External Listener

Dear GWT Users,

Thanks in advance for any help.

I have working CellBrowser that I want to add an external listener to (so that I can display data clicked on... but outside and in another panel).  I see CellBrowser implements HasClickHandlers (and addClickHandler).

http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/cellview/client/CellBrowser.html

I can successfully handle an event internally in my Cell i.e.

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());
}
}

I thought (given the interfaces it implements) I could do something like

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



--
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