Closed DanielMartensson closed 4 years ago
I haven't tested your code but this looks wrong. Why do you create two instances?
Upload pictureUpload = new PictureUpload().getUpload();
Div output = new PictureUpload().getOutput();
I haven't tested your code but this looks wrong. Why do you create two instances?
Upload pictureUpload = new PictureUpload().getUpload(); Div output = new PictureUpload().getOutput();
Because I want to get the output and the picture uploader. My code is far more complex and I posted the minimum code.
Your code works 100% for me - except that I had to change
Upload pictureUpload = new PictureUpload().getUpload();
Div output = new PictureUpload().getOutput();
to
PictureUpload upload = new PictureUpload();
layout.add(upload.getUpload());
layout.add(upload.getOutput());
Java 8 / Vaadin 14.1.27
Your code works 100% for me - except that I had to change
Upload pictureUpload = new PictureUpload().getUpload(); Div output = new PictureUpload().getOutput();
to
PictureUpload upload = new PictureUpload(); layout.add(upload.getUpload()); layout.add(upload.getOutput());
Java 8 / Vaadin 14.1.27
Does not work for me.
```
public LoadExportTemplate() {
subjectCounterExportButtonUploaders = new VerticalLayout();
Upload pictureUpload = new PictureUpload().getUpload();
Div output = new PictureUpload().getOutput();
subjectCounterExportButtonUploaders.add(pictureUpload);
subjectCounterExportButtonUploaders.add(output);
}
It can't work, because you have two different instances of PictureUpload
. Replace your code with the following:
subjectCounterExportButtonUploaders = new VerticalLayout();
PictureUpload pictureUpload = new PictureUpload();
subjectCounterExportButtonUploaders.add(pictureUpload.getUpload());
subjectCounterExportButtonUploaders.add(pictureUpload.getOutput());
It can't work, because you have two different instances of
PictureUpload
. Replace your code with the following:subjectCounterExportButtonUploaders = new VerticalLayout(); PictureUpload pictureUpload = new PictureUpload(); subjectCounterExportButtonUploaders.add(pictureUpload.getUpload()); subjectCounterExportButtonUploaders.add(pictureUpload.getOutput());
Now I see! Thank you! It works now!
Description of the bug
When I upload the picture, the picture does not show up.
Minimal reproducible example
MainView.
Expected behavior
I picture should show up.
Actual behavior
Picture does not show up when I upload it.
Versions:
Picture of the problem
https://i.ibb.co/60r2Wrr/S-lection-008.png