flowUI, camera device, how to use: input type=file accept=image

Hi,

in html5 it is possible to use something like this:

But in JMIX FlowUI the attribute accept is not allowed.

I need to use the mobile camera to take a photo and save it as an image.
How to handle that?

Kind Regards
Roland

found it… now I need to find out how to save it… but that is another story :slight_smile:

public void onInit(final InitEvent event) {
Grid.Column uploadColumn = tourObjectsDataGrid.addComponentColumn(camera → {
FileUploadField fileUploadField = uiComponents.create(FileUploadField.class);
fileUploadField.setAcceptedFileTypes(“image/*”);
fileUploadField.getElement().setAttribute(“capture”, “camera”);
return fileUploadField;
});

1 Like