Ok, following 1) I've got the code bellow.
Now, how can I define an event handler on a view which wraps this
CellTable??
These handlers are suposed to be defined by view and not by cells!!
public class TextCellNX extends AbstractSafeHtmlCell<String> {
public TextCellNX() {
super(SimpleSafeHtmlRenderer.getInstance(), "contextmenu");
}
public TextCellNX(SafeHtmlRenderer<String> renderer) {
super(renderer);
}
@Override
public void render(Context context, SafeHtml value, SafeHtmlBuilder
sb) {
if (value != null) {
sb.append(value);
}
}
@Override
public void onBrowserEvent(Context context, Element parent, String
value, NativeEvent event, ValueUpdater<String> valueUpdater) {
String eventType = event.getType();
if ("contextmenu".equals(eventType)) {
event.preventDefault();
MenuBar popupMenuBar = new MenuBar(true);
MenuItem acao1 = new MenuItem("Ação 1", true, new
Command() {
@Override
public void execute() {
Window.alert("clicado");
//placeController.goTo(new
ProxyListPlace(ClienteProxy.class));
}
});
popupMenuBar.addItem(acao1);
popupMenuBar.setVisible(true);
PopupPanel popupPanel = new PopupPanel(true);
popupPanel.add(popupMenuBar);
popupPanel.setPopupPosition(event.getClientX(),
event.getClientY());
popupPanel.show();
}
}
}
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.