Fileupload: Changing browse button attributes

UI Components for JSF
Post Reply
krishna.alluru
Posts: 70
Joined: 21 Mar 2011, 17:25

30 Mar 2011, 15:19

Hi,

Please let me know how to change file upload browse button attributes like background color, text, width, height, padding and margins through CSS. We are using version 2.2

We are using file upload code as below.
<p:fileUpload fileUploadListener="#{FilieController.handleupload}" multiple="true" allowTypes="*.jpg;*.png;*.gif;*.pdf;" description="Evidence" label="Browse">
</p:fileUpload>

Thanks and Regards,
Krishna
______________
primefaces 2.2.1
Weblogic 10.3.2

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

30 Mar 2011, 20:36

2.2's fileupload button is flash so css can't apply. 3.0(in development)'s fileupload does not use flash and can be styled with css selectors like 'ui-fileupload-browser'.

User avatar
ydarcin
Posts: 258
Joined: 04 Jan 2009, 19:02
Location: Turkey

31 Mar 2011, 09:21

btw,

from the PrimeFaces guide page 178, you can change the button of the fileupload like

Code: Select all

<p:fileUpload widgetVar="uploader" fileUploadListener="#{fileBean.handleFileUpload}" height="48" width="48" image="/images/browse.png" cancelImage="/images/cancel.png" customUI="true"/>
<h:outputLink value="#" title="Upload" onclick="uploader.upload();"> Upload Files
</h:outputLink>
maybe this can help.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 71 guests