flow-components icon indicating copy to clipboard operation
flow-components copied to clipboard

Upload is missing isReadOnly

Open sveinnetnordic opened this issue 1 year ago • 5 comments
trafficstars

Describe your motivation

Found it missing

Describe the solution you'd like

Button and drop filed should be marked readonly and drop should not be allowed

Describe alternatives you've considered

No response

Additional context

No response

sveinnetnordic avatar Jun 04 '24 07:06 sveinnetnordic

A kind of a workaround, not pretty because the field change:

uploadField.element.isEnabled = false
uploadField.isDropAllowed = false

sveinnetnordic avatar Jun 04 '24 07:06 sveinnetnordic

Related issue: https://github.com/vaadin/web-components/issues/1278

Legioth avatar Jun 04 '24 07:06 Legioth

A better workaround is this then: uploadField.maxFiles = if (it.value) 0 else 1 but need to set it correct for multi/single, and the button changes form Upload file... to Upload files...

sveinnetnordic avatar Jun 04 '24 07:06 sveinnetnordic

Upload does not have field nature, but it can be used in a custom field. There is an example of using Upload component in CustomField here

https://stackoverflow.com/questions/66154593/vaadin-upload-component-in-binder-e-g-crud-editor

TatuLund avatar Jun 04 '24 08:06 TatuLund

Upload does not have field nature, but it can be used in a custom field. There is an example of using Upload component in CustomField here

https://stackoverflow.com/questions/66154593/vaadin-upload-component-in-binder-e-g-crud-editor

Setting new UploadField() readonly did not have any effect

sveinnetnordic avatar Jun 05 '24 06:06 sveinnetnordic