Hi,
I am creating a moderate sized CellTable - 100 rows and 5 columns. In some
of the columns I need to show small images (no text) depending on the value
returned by the accessor method of the backing object for the row. The
number of images are fixed i.e. the logic is basically to display one of 5
images in a cell.
I had trouble working with a ClientBundle for my Images so as a work
around, I did it with the following approach:
TextColumn<RowData> markedColumn = new TextColumn<RowData>() {
public String getValue(RowData object) {
return "";
}
public String getCellStyleNames(Context context, RowData object) {
if(object.getMarkedStatus()){
return "MARKED";
}
else{
return "";
}
}
};
Now, my ClientBundle stuff is working and the following code works as well:
Column<RowData, ImageResource> markedColumn1 = new Column<RowData,
ImageResource>(new ImageResourceCell()) {
public ImageResource getValue(RowData object) {
if(object.getMarkedStatus()){
return ImageResourceBundle.INSTANCE.rtick();
}else{
return null; <-- I am not sure how to create an Empty cell. I
guess I can return an empty/blank image here.
}
}
};
Now, I am not sure which approach is better. I am thinking that since
stylesheets are in generate better in performance, the first approach is
better. Is that correct? The app will be used on mobile devices.
thank you!
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.