I am new to Vaadin and so far I am loving developing with it. I have hit a road-block with a requirement where I want to use and editable Image Field as part of a FieldGroup.
- I get a byte array of an image from the database (stored as a blob) and I convert it to StreamResource using:
StreamSource imagesource = new ImageSource(bytes);
StreamResource resource = new StreamResource(imagesource, "Uploaded File");
2. I need to display this image with an upload button where user can choose to upload a new image. This uploaded new image now replaces the image displayed in step 1.
I was thinking in terms of a CustomField creation with an Image and Upload option but I cannot seem to move further on this one.
Would be of great help if I can get my hands on a similar example or pointers in the right direction.
Thanks for the help!