Element fileStorageUpload not allowed when using FileRef attribute

Hi,

I’m using jmix 1.4.2 with incubating FlowUI. i try to upload a file and got an error stated
“Element fileStorageUpload is not allowed here”. is there any way i can solve this. i do also follow jmix documentation (link below) but failed.
https://docs.jmix.io/jmix/ui/vcl/components/file-storage-upload-field.html
image

Hello!

The documentation you follow is not for Flow UI. The Flow UI documentation is under development stage.

For now, Flow UI does not contain fields for uploading files. But you can use Upload Vaadin component from the controller, e.g. (Jmix 1.4 release candidate - #12 by krivopustov):

@ViewComponent
private FormLayout form;

@Autowired
private FileStorage fileStorage;

@Subscribe
public void onInit(InitEvent event) {
    MemoryBuffer memoryBuffer = new MemoryBuffer();
    Upload upload = new Upload(memoryBuffer);
    upload.setMaxFiles(1);
    upload.addFinishedListener(event1 -> {
        FileRef fileRef = fileStorage.saveStream(memoryBuffer.getFileName(), memoryBuffer.getInputStream());
        getEditedEntity().setPicture(fileRef);
        updateImage();
    });
    form.add(upload);
}

thank you for the answer