Giter Site home page Giter Site logo

Comments (6)

christophs78 avatar christophs78 commented on July 22, 2024 1

Idea 1:
image

from primefaces.

melloware avatar melloware commented on July 22, 2024

PR submitted. Thanks for the report!

from primefaces.

christophs78 avatar christophs78 commented on July 22, 2024

Related issues which triggered refactorings for 14.0.0: #11001, #11043, #11044

We may have to look into the assigned commits.

Up to 13.0.x following JS was rendered:

pf.cw("FileUpload","widget_j_idt342_j_idt344",{id:"j_idt342:j_idt344",resumeContextPath:"\/showcase\/file\/resume\/",mode:"advanced",update:"j_idt342:messages",maxFileSize:100000.0,allowTypes:/(\.\|\/)(gif\|jpe?g\|png)$/});

Starting with 14.0.x maxFileSize is rendered into HTML:

<input type="file" id="j_idt247:j_idt249_input" name="j_idt247:j_idt249_input" aria-hidden="true" tabindex="-1" data-p-label="Choose" data-p-sizelimit="100000" data-p-allowtypes="/(\.|\/)(gif|jpeg|jpg|png)$/" data-p-val="primefaces.File" />
pf.cw("FileUpload","widget_j_idt247_j_idt249",{id:"j_idt247:j_idt249",mode:"advanced",update:"j_idt247:messages"});

The missing link is to find a way to access data-p-sizelimit also during drag´n´drop.

from primefaces.

christophs78 avatar christophs78 commented on July 22, 2024

Ok - now i understand why @melloware gave up on this ...

Doing following is only a small part of the solution:

var dataFileInput = data.fileInput ? data.fileInput : $('#' + $.escapeSelector(data.paramName + '_input'));

The other issue is following:
image

image

At this point any quick solution seems to be out of scope. At least for now. p:FileUpload Drag´n´Drop - support is gone for now.

from primefaces.

christophs78 avatar christophs78 commented on July 22, 2024

Added a commit with part of a possible solution.

But it still fails for more than one file because of:
image

Maybe someone else can come up with further ideas.

from primefaces.

melloware avatar melloware commented on July 22, 2024

@christophs78 you have come to a similar place where I landed so I just fixed the NPE to at least restore the drag and drop functionality.

from primefaces.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.