Is there a browse button in JSF?
I need this for the import functionality of the web-based app im creating. I need to get the path of a text file the user wa开发者_Python百科nts to be imported in order to egt the data inside the text file and saves it in a database.
There is no such component in standard JSF. However, there are several component libraries that offer file selection:
- PrimeFaces
<p:fileUpload>
- RichFaces
<rich:fileUpload>
- IceFaces
<ice:inputFile>
- Tomahawk
<t:inputFileUpload>
- etc. - basically every JSF component framework has such a component
You could check this out - http://livedemo.exadel.com/richfaces-demo/richfaces/fileUpload.jsf, and build yours accordingly.
精彩评论