datagrid - Clear the renderer from a Grid column in Vaadin 8.1 -
in vaadin framework 8.1 app, on grid widget, how 1 clear column renderer after setting it?
we can set renderer on grid.column
calling setrenderer
. how un-set it?
passing null
results in null pointer exception:
java.lang.nullpointerexception: renderer can not null
the default behavior before setting renderer seems calling tostring
on column’s objects.
➟ how default behavior?
there no way ask vaadin revert default.
before setting new renderer, can ask existing default renderer.
renderer<?> r = this.columninstant.getrenderer() ;
then later re-apply it.
mygridcolumn.setrenderer( r ) ;
commonly, default renderer com.vaadin.ui.renderers.textrenderer
. can instantiate new 1 if more convenient retaining reference old one.
mygridcolumn.setrenderer( new com.vaadin.ui.renderers.textrenderer() ) ;
Comments
Post a Comment