Skip to content

Update Dropzone "Max Files" dynamically #83

Description

Hi

APEX OCI, 20.2

In my project I want to limit the user to uploading 6 images per product. On the page I have 3 hidden fields:

P1_DROPZONE_NO_IMAGES
select count(*) from my_table where id = :P1_ID

P1_DROPZONE_MAX_IMAGES
static =
6

P1_DROPZONE_FILE_COUNT
= :P1_DROPZONE_MAX_IMAGES - :P1_DROPZONE_NO_IMAGES

The DROPZONE attributes
max Files: &P1_DROPZONE_FILE_COUNT.

When I refresh the page and i have 4 images stored in db my values are :
P1_DROPZONE_NO_IMAGES = 4
P1_DROPZONE_MAX_IMAGES = 6
P1_DROPZONE_FILE_COUNT = 2

And i cannot load any more than 2 images using Dropzone. However when i upload one image my values are now:
P1_DROPZONE_NO_IMAGES = 5
P1_DROPZONE_MAX_IMAGES = 6
P1_DROPZONE_FILE_COUNT = 1

But I can still then add a further 2. The value of P1_DROPZONE_FILE_COUNT is 1 but the Max Files in Dropzone is still 2. I have tried refreshing the DropZone region.

How can I make sure Dropzone MaxFiles is updated correctly please?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions