2011/4/4 Luca Morettoni <[email protected]>:
> Hello list, I have a CellDataTable that display some object of my
> application; some of that object could be added manually by the user
> and other are fetched from the server; the user can delete only the
> ones added by hand, for this I have a column on my table that render a
> Button, when the user click I need to check if the data row is manual
> or not before removing it; there is a way to don't render a cell
> depending on a specific value?
> This is the current code:
>
> // table declaration:
> CellTable<MyDataProxy> table;
>
> // Only manual added rows can be deleted
> Column<MyDataProxy, String> deleteColumn = new
> Column<MyDataProxy, String>(
> new ButtonCell()) {
> public String getValue(CompoundDataProxy c) {
> return "Delete";
> }
> };
resolved, I just overrided the render method:
Column<MyDataProxy, String> deleteColumn = new
Column<MyDataProxy, String>(
new ButtonCell()) {
public String getValue(MyDataProxy c) {
return "Delete";
}
@Override
public void render(Context context,
MyDataProxy c, SafeHtmlBuilder sb) {
if (c.isManualAdded())
super.render(context, c, sb);
}
};
and the button is rendered only for manual added informations!
--
Luca Morettoni <luca(AT)morettoni.net> | http://www.morettoni.net
gtalk/msn: luca(AT)morettoni.net | http://twitter.com/morettoni
jugUmbria founder: https://jugUmbria.dev.java.net/ | skype: luca.morettoni
--
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.