Safari Bug with Custom SVGCell in Datagrid

7 views
Skip to first unread message

pi

unread,
Mar 20, 2015, 2:59:33 AM3/20/15
to lib-g...@googlegroups.com
Hi folks,

I'm having an issue (only in Safari 8.0.4) while displaying a SVG in a cell of a datagrid. Following code runs without issues in Chrome 41.0.2272.101.

package xyz.svgdemo.client;


import org.vectomatic.dom.svg.ui.SVGImage;

import org.vectomatic.dom.svg.ui.SVGResource;


import com.google.gwt.cell.client.AbstractCell;

import com.google.gwt.safehtml.shared.SafeHtmlBuilder;

import com.google.gwt.user.cellview.client.Column;

import com.google.gwt.user.cellview.client.DataGrid;

import com.google.gwt.view.client.ListDataProvider;


public class SVGDatagrid extends DataGrid<String> {


private SVGResource svgResource;


private class SVGCell extends AbstractCell<String> {


@Override

public void render(Context context, String value, SafeHtmlBuilder sb) {

SVGImage svgImage = new SVGImage(svgResource);

sb.appendHtmlConstant(svgImage.toString());

}

}


public SVGDatagrid(SVGResource svgResource) {

this.svgResource = svgResource;

setWidth("400px");

setHeight("300px");


Column<String, String> columnSVG = new Column<String, String>(

new SVGCell()) {


@Override

public String getValue(String object) {

return object;

}

};

addColumn(columnSVG, "svg");


ListDataProvider<String> dataProvider = new ListDataProvider<String>();

dataProvider.getList().add("dummy");

dataProvider.addDataDisplay(this);

}


}


Thanks in advance.
KR Peter 

Lukas Laag

unread,
Mar 22, 2015, 2:57:42 PM3/22/15
to lib-g...@googlegroups.com
Hi,

Can you give more details on the issue itself ? Do you have a JS
exception, browser crash, incorrect display ?

Regards

Lukas

Reply all
Reply to author
Forward
0 new messages