In my JSF 2.0 – Primefaces application I am using I DO NOT want to have
- progress bar
- upload button
- cancel button
which shows up adjacent to the selected image(once the image is selected)
Another issue is the ‘fileLimit’ I want to set it to 1 but when I do that it says invalid attribute.
Here is my code:
<p:fileUpload id="related_image" fileUploadListener="#{fileUploadController.handleFileUpload}"
mode="advance"
auto="false"
showButtons="false"
sizeLimit="100000"
fileLimit ="1"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
style="width: 310px"/>
Basically all you have to do is to assign find out the right css selectors and set them with
display:none;(put them in your .css file and include it with<h:outputStylesheet)in general (in css you need to escape the colon with
\3aHandling a colon in an element ID in a CSS selector , while in jquery you should use\\:)or (sometimes there is no prefix before your_file_upload_component_id )
Although , INMO , best approach would be assigning an id to your form and using this selector in css :
Now to the exact selectors…
so to remove the upload button
or if you want to do the same with jquery
to remove the cancel button which shows up adjacent to the selected image(once the image is selected)
or if you want to do the same with jquery
to remove progress bar
or if you want to do the same with jquery
You can test the jquery approach on primefaces showcase if you want , just replace the
#related_imagewith#j_idt19\\:j_idt20for example$("#j_idt19\\:j_idt20 .start").hide();There is no such attribute as
fileLimittake a look at the Tag fileUpload