You simply can't do this in web apps.  You don't choose where to write
something to - you don't have access to write anything to the user's
computer.  All you can do is give the user a file to download, and the
browser will automatically ask them for what folder they want to save it
to.  For this, search Nabble or Google for "DownloadLink".

Give the user a link (DownloadLink) to a file.  They click it.  The browser
opens your dialog for you.


-- 
Jeremy Thomerson
http://www.wickettraining.com

On Fri, Nov 7, 2008 at 11:48 AM, Shyam Narayanan <
[EMAIL PROTECTED]> wrote:

> Thanks for your reply.
>
> My main aim of this task is to download an item into the directory user
> selects.
>
> So need to open a file dialog to help user choose a directory and then from
> it get the path user chose, so as to proceed with my
> download.
>
> So as you can imagine for this, i have a browse kindoff button for user to
> chose a directory and as it closes, need to display the path selected in a
> text field.
> The button as well as textfield stand on a wicket page. Just the action of
> opening a file browser is what i want.
>
> I am very new to wicket. Could you pls explain more on what i would have to
> do to open such a dialog nd then get the path selected ?
>
> A code example would be appreciated.
>
> Thanks
> ________________________________________
> From: Jeremy Thomerson [EMAIL PROTECTED]
> Sent: Friday, November 07, 2008 9:01 PM
> To: [email protected]; [EMAIL PROTECTED]
> Subject: Re: File Chooser dialog needed
>
> Swing classes are not in the same heirarchy as Wicket's and the two are not
> made to work together.  What you need is to add an <input type="file" ....
> /> and a FileUpload (Wicket class).  However, you can't have a user just
> select a directory from their browser - this is a limitation of web apps.
> Besides, what could you possibly do with that directory path once you had
> it?  You don't have access to their local computer....
>
> Depending on what you're doing, if you really had to do something with a
> directory, you may have to <horror-music-starts> use an applet
> </horror-music>.
> Hope this helps.
>
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
> On Fri, Nov 7, 2008 at 5:04 AM, 123shyam <[EMAIL PROTECTED]>
> wrote:
>
> >
> > Hello,
> >
> > I am working on wicket. I need to open a filechooser dialog or a file
> open
> > =
> > dialog (like we have in JFileChooser).
> >
> > I am currently unable to implement it from my wicket page. All I want is
> a
> > =
> > file chooser dialog showing only directories , user chooses nd I get back
> > t=
> > he path selected.
> >
> > I tried to call a JFielChosser (sinwg) thorught wicket but there seems to
> > b=
> > e some problem, the dialog cmes in a different location first time and in
> > t=
> > he center of the 2nd time onwards, I guess the modality is wrong. The
> > JFile=
> > Chooser needs a Component object type as its parent. But I am unable to
> > pas=
> > s it from thewicket class. It cannot be cast to a Component or Window.
> > Kindly help me out on this.
> >
> > Thanks,
> > Shyam
> > --
> > View this message in context:
> >
> http://www.nabble.com/File-Chooser-dialog-needed-tp20378500p20378500.html
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> This message (including attachment if any) is confidential and may be
> privileged. If you have received this message by mistake please notify the
> sender by return e-mail and delete this message from your system. Any
> unauthorized use or dissemination of this message in whole or in part is
> strictly prohibited. E-mail may contain viruses. Before opening attachments
> please check them for viruses and defects. While MindTree Limited (MindTree)
> has put in place checks to minimize the risks, MindTree will not be
> responsible for any viruses or defects or any forwarded attachments
> emanating either from within MindTree or outside.
>
> Please note that e-mails are susceptible to change and MindTree shall not
> be liable for any improper, untimely or incomplete transmission.
>
> MindTree reserves the right to monitor and review the content of all
> messages sent to or from MindTree e-mail address. Messages sent to or from
> this e-mail address may be stored on the MindTree e-mail system or else
> where.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to