vferrer
25 Mar 2009, 8:32 AM
Hello,
I'm traying to add a GridRendererer to a cell ussing GridCellRendererer parametrized with an own type. The code looks like this:
avTextoColumn.setRenderer(new GridCellRenderer<Aviso>() {
public String render(Aviso model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<Aviso> store) {
if (model != null && model.get(property) != null) {
return "<div style=\"white-space: normal ! important;\">" +
model.get(property) +
"</div>";
}
return "";
}
});
That code works fine when I compile with GWTCompiler and test throught Firefox (or some external browser) but fails if I test it with the Hosted Mode Browser.
I've been debugging the code, making some tests and I've seen that the code:
avTextoColumn.setRenderer(new GridCellRenderer<ModelData>() {
public String render(ModelData model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<ModelData> store) {
Aviso aviso = (Aviso) model;
return "";
}
also fails with a ClassCastException, but Aviso is a Bean that extends BaseModel (like the documentation says)
Somebody knows what could be the problem? It would be a bug?
Thanks in advance,
Vicente Ferrer
I'm traying to add a GridRendererer to a cell ussing GridCellRendererer parametrized with an own type. The code looks like this:
avTextoColumn.setRenderer(new GridCellRenderer<Aviso>() {
public String render(Aviso model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<Aviso> store) {
if (model != null && model.get(property) != null) {
return "<div style=\"white-space: normal ! important;\">" +
model.get(property) +
"</div>";
}
return "";
}
});
That code works fine when I compile with GWTCompiler and test throught Firefox (or some external browser) but fails if I test it with the Hosted Mode Browser.
I've been debugging the code, making some tests and I've seen that the code:
avTextoColumn.setRenderer(new GridCellRenderer<ModelData>() {
public String render(ModelData model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<ModelData> store) {
Aviso aviso = (Aviso) model;
return "";
}
also fails with a ClassCastException, but Aviso is a Bean that extends BaseModel (like the documentation says)
Somebody knows what could be the problem? It would be a bug?
Thanks in advance,
Vicente Ferrer