Hi,
I tried to display images in one Column of my Grid by using the ImageRenderer. The image files I want to display are outside of the application anywhere on my file system. So I tried the following:
getColumn(myDTO.PICTURE).setRenderer(new ImageRenderer(), new Converter<Resource, String>() {
@Override public String convertToModel(final Resource resource, final Class<? extends String> aClass, final Locale locale) throws ConversionException
{ return “not needed”; }
@Override public Resource convertToPresentation(final String absolutePath, final Class<? extends Resource> aClass, final Locale locale) throws ConversionException
{
return new FileResource(new File(absolutePath))
; }
@Override public Class getModelType()
{ return String.class; }
@Override public Class getPresentationType()
{ return Resource.class; }
});
But this is producing the following IllegalArgumentException: java.lang.IllegalArgumentException: ImageRenderer only supports ExternalResource and ThemeResource (FileResourcegiven )
So my question is: Will the FileResource be supported by ImageRenderer in future releases? Or is there another way of displaying images in my grid from anywhere on the local file system? Thank You!
Greetings,
Marco