Remove/Disable upload button

UI Components for JSF
Post Reply
User avatar
afterbit
Posts: 93
Joined: 19 Mar 2012, 23:51
Contact:

28 Sep 2021, 18:23

Hello,
I need to create a form with some data and one or more files to upload along with the data ..

I am using the <p: fileUpload> component, but in mode = "advanced" and multiple = "true" it shows the upload button which, if clicked, starts the upload ..

instead I want to load files and other data together by pressing the save button (see image)

Image
thumbnail hosting

is it possible?
thanks!
p.s. in mode = "simple" the upload button is not shown, but I can see the list of files under the upload component ..

Melloware
Posts: 2860
Joined: 22 Apr 2013, 15:48

29 Sep 2021, 01:17

If PF 11.0.0 you can do

Code: Select all

uploadButtonStyleClass="ui-helper-hidden-accessible"
to hide the upload button. Not sure what version PF you are on but you can probably do the same with some simple Jquery to hide the upload button.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 10.0.7 / PF Extensions 10.0.6

User avatar
afterbit
Posts: 93
Joined: 19 Mar 2012, 23:51
Contact:

29 Sep 2021, 15:56

unfortunately i'm using PF 10...

User avatar
afterbit
Posts: 93
Joined: 19 Mar 2012, 23:51
Contact:

29 Sep 2021, 16:59

i solved with jquery :

$("div[id='mFUpload:uploadComp']").find("div.ui-fileupload-buttonbar > button.ui-fileupload-upload").hide();

where mFUpload:uploadComp are :

mFUpload is the ID of the form component
uploadComp is the ID of the upload component

.. any suggestion is welcome ..

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests