PDA

View Full Version : icon in GridPanel. What's wrong?



F43RY
11 Sep 2009, 7:45 AM
Hi,
with the code below I can't see icons in the grid but the following String:

code.google.gwt.user.client.ui.impl.ClippedImagePrototype@f324fsdf

What's worng? The result is shown in the attached image.




ColumnConfig alert = new ColumnConfig("alert", "Alert", 25);
alert.setRenderer(new GridCellRenderer(){
public Object render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex, ListStore store, Grid grid) {
if(model.get("category").equals(Category.PAPER){
return IconHelper.createStyle("accept.png");
}else{
return IconHelper.createPath("exclamation.png");
}
}
});


Thanx

sven
11 Sep 2009, 7:46 AM
You dont return a widget or a string.



return IconHelper.createPath("exclamation.png").createImage();


or




return IconHelper.createPath("exclamation.png").getHTML();


That is what you are looking for.

F43RY
11 Sep 2009, 7:56 AM
ok, it works, I'm a noob. ~o)
Sorry for such stupid questions.