I'm having a problem with a JFileChooser 'cause I'm trying to pop it up from an action inside a . The backing bean creates a file chooser but it shows up behind the browser, behind everything, actually.
I'm using a file chooser instead of because I need to know the complete path of the file, and that tag doesn't do the work.
Is there any way to focus the file chooser above any other element on the screen?
You can't do this. What's happening now, the reason it is kind of working, is because your local machine is the server, so when you execute the server side code, you see it happen. If you were to access your application from a non-server machine, you'd never see the file chooser.
The only to do what you want is to use an Applet to embed the ability for the client to launch the file chooser. Generally, there's no real need to have the clients full file path because all you should care about is the file itself. If you need something more than that, consider why you chose to use a web application in the first place.
Thanks. You're right, I can't; plus, I can't embed it in an applet. I'm toasted and depending on js tricks to find out that path cause focusing only on the file as a byte array gives me different results depending on the browser.
[quote=Hernán Quevedo]... focusing only on the file as a byte array gives me different results depending on the browser.[/quote]
If you're doing a standard file upload (via <input type="file">) then the only difference you should see between browsers is that Internet Explorer (some versions, anyway) gives you the complete file path and other browsers just give you the name of the file. The bytes you get as file data should be identical in both cases.
And since the directory the file was uploaded from is (or definitely should be) irrelevant to your application, you should just ignore that if you get it.