Are you sure you don't want to use a ButtonCell? Seems to be way more convenient ;)
On 17 Aug., 22:29, nacho <[email protected]> wrote: > I need to put some kind of Button in a CellTable column. > > I created a class that extends AbstractCell: > > public class AnchorCell extends AbstractCell<Anchor> { > > @Override > public void onBrowserEvent(com.google.gwt.cell.client.Cell.Context > context, > Element parent, Anchor value, NativeEvent event, > ValueUpdater<Anchor> valueUpdater) { > > Window.alert("hello"); > > } > > @Override > public void render(com.google.gwt.cell.client.Cell.Context context, > Anchor h, SafeHtmlBuilder sb) { > sb.append(SafeHtmlUtils.fromTrustedString(h.toString())); > } > > } > > And then, when I am working with my CellTable, I create a column in this > way: > > Column<CompanyModel, Anchor> actionsColumn = new Column<CompanyModel, > Anchor>(new AnchorCell()) { > > @Override > public Anchor getValue(CompanyModel company) { > Anchor h = new ActionsButton(company.getCompanyId(), > "Acciones " + company.getCompanyId()); > return h; > } > > }; > > But I can't get the browser events.. How can I perform some action when my > widget is clicked? -- 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.
