简体   繁体   中英

Can a h:inputFile component be internationalized in JSF 2.2

I am using JSF 2.2.12 mojarra implementation on Glassfish 4.1.1. I have an upload form including ah:inputFile component. Everything works just fine except that I can not find the way to change the "choose file..." message to an other one. I can not believe that the HTML5 specs and/or JSF 2.2 does not provide any solution yet, so obviously it is my mistake. I tried primefaces 5.3 which gives the opportunity to use different language than english on the button of the upload component but I could not style it.

Is there any JSF 2.2 "compatible" way to handle this?

Try primefaces component fileUpload that comes with three buttons on advanced mode : choose , upload , cancel . You can edit the text on the buttons by changing the options label , uploadLabel , cancelLabel .

Concerning the styles, i suggest changing the style in the css class of the buttons, to change colors, or icons.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM