Tuesday, December 25, 2012

Re: CellTable not rendering rows in production mode?

If anybody stumbles on this issue:
I had it when I used objects containing nested objects (java.util.logging.LogRecord) for my CellTable content class.
Something like
class LogValues {
  private LogRecord record;
  public LogRecord getRecord() { return record;}
}


Column<LogValues, Date> dateColumn = new Column<LogValues, Date>(dateCell) {
@Override
public Date getValue(LogValues log) {
// TODO Auto-generated method stub
return new Date(log.getRecord().getMillis());
}
};
TextColumn<LogValues> msg = new TextColumn<LogValues>() {
@Override
public String getCellStyleNames(Context context, LogValues log) {
return "log_"+log.getRecord().getLevel();
}

@Override
public String getValue(LogValues log) {
return log.getRecord().getMessage();
}

In this case, the CellTable did not render in compiled mode, while it worked fine in development mode.
On a hunch, I flattened LogValues and copied the required data to fields, so I could drop the getRecord() call.
--> Now it does render.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/fARKGLa_yqIJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment