Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » The curious RAP FileDialog
The curious RAP FileDialog [message #838080] Fri, 06 April 2012 10:38 Go to next message
Georges Bachelier is currently offline Georges Bachelier
Messages: 25
Registered: May 2010
Junior Member
Hello Everybody !

I have successfully and easily converted a simple RCP application to a RAP one.

Encouraged by this first success, I started to convert a second simple application of mine which reads an input file from the file-system, encrypts it and writes the encrypted file to the file-system.

The GUI is very simple: a Text widget and a Browse button for the input file; the same couple of widgets for the encrypted output file. I use the FileDialog widget from RAP 1.4 Incubator to specify the input and output files pathnames.

The current FileDialog behavior does not suit my needs: it contains its own Browse button, which means the user has to click two Browse buttons before the file selection dialog pops up. This is the first issue. The second problem is that the dialog only displays the selected file name, not its full pahname on the user's file system. The third issue arises when I update the Text widget with FileDialog.getFileName() which displays a strange file pathname including a \Temp folder and adds a series of numbers to the file name ,like in util.2624504061871153546.jar.

Is there a chance that the RAP FileDialog behavior evolves in the future, making it usable the same way than the regular SWT one, or is my request absolutely ridiculous ?

In others words, should I wait for the June release (or more), or abandon RAP (which would be really disappointing).

Thanks a lot in advance for your time !

Georges
Re: The curious RAP FileDialog [message #838134 is a reply to message #838080] Fri, 06 April 2012 12:06 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1796
Registered: July 2009
Senior Member
Hi Georges,
There is a big difference between SWT and RAP FileDialog. This is
basically due to client-server nature of RAP. The RAP FileDialog browse
for a file on the client file system and upload it to the server.
> The current FileDialog behavior does not suit my needs: it contains
> its own Browse button, which means the user has to click two Browse
> buttons before the file selection dialog pops up. This is the first
> issue.
If you want to open a "file selection dialog" directly you have to use
FileUpload RAP widget instead. See
"org.eclipse.rap.rwt.supplemental.filedialog.demo\src\org\eclipse\rap\examples\demo\fileupload\FileUploadExamplePage.java"
from CVS for an example how to use it.

> The second problem is that the dialog only displays the selected file
> name, not its full pahname on the user's file system.
Due to browser security restriction it's not possible to get the full
path on the user's file system.

> The third issue arises when I update the Text widget with
> FileDialog.getFileName() which displays a strange file pathname
> including a \Temp folder and adds a series of numbers to the file name
> ,like in util.2624504061871153546.jar.
The file name returned from the FileDialog.getFileName() is the path
where the file is uploaded on the server (in the temp folder). In CVS
HEAD we changed this path from:
"...\Temp\util.2624504061871153546.jar"
to
"...\Temp\fileupload_2624504061871153546\util.jar"
Thus, we keep the original file name unchanged.
HTH,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: The curious RAP FileDialog [message #840535 is a reply to message #838134] Tue, 10 April 2012 03:52 Go to previous messageGo to next message
Georges Bachelier is currently offline Georges Bachelier
Messages: 25
Registered: May 2010
Junior Member
Hi Ivan!

Thanks a lot for your reply. Everything is perfectly clear now, but I foresee an issue with the file selection mechanism in RAP. In many applications, we save user's entries from dialogs and wizards to a settings file. Settings are then loaded during the next session.

Since I cannot get local files pathnames selected by the user, I am afraid RAP applications cannot fully support saving and reloading user's settings. Am I right? Can you see a workaround to this?

Many thanks in advance for your time,

Georges
Re: The curious RAP FileDialog [message #840579 is a reply to message #840535] Tue, 10 April 2012 05:02 Go to previous message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1796
Registered: July 2009
Senior Member
Hi Georges,
save and reload of the user settings is done on the server, not on the
client. See RWT#getSettingsStore for more details.
Best,
Ivan

On 4/10/2012 10:52 AM, Georges Bachelier wrote:
> Hi Ivan!
>
> Thanks a lot for your reply. Everything is perfectly clear now, but I
> foresee an issue with the file selection mechanism in RAP. In many
> applications, we save user's entries from dialogs and wizards to a
> settings file. Settings are then loaded during the next session.
>
> Since I cannot get local files pathnames selected by the user, I am
> afraid RAP applications cannot fully support saving and reloading
> user's settings. Am I right? Can you see a workaround to this?
>
> Many thanks in advance for your time,
>
> Georges

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:CKEditor for RAP usage
Next Topic:Session Timeout Warning
Goto Forum:
  


Current Time: Mon Sep 01 22:04:45 EDT 2014

Powered by FUDForum. Page generated in 0.04823 seconds