I have managed to get this to work, but I'm not sure if what I did is the best way to do it and/or if it's a safe and reliable way. In the HTML (UploadPanel.html), I have a form with an applet tag. Within UploadPanel.java I'm creating a WebMarkupContainer for the applet and using it to pass the URL for form "action" to the applet so that the applet can post uploads back to wicket. In order to do this, I have to pass to the applet the same exact URL that wicket is generating for the "action" attribute of the form.
By digging in the wicket.markup.html.form.Form class, I see that the wicket generates the "action" attribute with this line of code: Strings.replaceAll(urlFor(IFormSubmitListener.INTERFACE), "&", "&") When I attempted to insert this code into the contructor of my Form object, it didn't work because the parent was not yet set. I also tried inserting it in the constructor for the enclosing Panel, after the form had been added, but I got the same problem. So I needed to find some point between when the parent was set and when the page was rendered to run the above code and calculate the URL for the action attribute. The only place I could find to do this was by overriding the onAttach() method of the Form. When I do this, it works. My questions are: 1. Is this the safe and correct place to do this? If not, where/when should I be able to safely call this code? 2. What is the purpose of onAttach()? One further note: I also tried using onBeforeRender() and onRender(), but in each case I got an exception to the effect that you can't alter a component once rendering has begun. -MD igor.vaynberg wrote: > > i would wrap the applet in a wicket component that would do the necessary > wiring > > -igor > > > On 2/20/07, MadDog <[EMAIL PROTECTED]> wrote: >> >> >> I'm working on an application where we need to upload files. I've gotten >> the >> simple upload example via a form working just fine. However in order to >> enable drag and drop, we are using an applet to do the upload. I'd like >> to >> get some advice on the best way to do this. >> >> One way I can think of is to have some kind of non-showing form and have >> the >> applet fake out the http POST to upload to the form. (i.e., end up >> posting >> to some kind of URL like this: >> >> http://host:9000/app?wicket:interface=:0:content:upload:simpleUpload::IFormSubmitListener >> ). >> >> However, this seems like a hack and seems like it would be brittle. >> >> Is there a better way? Is there some way we could create some kind of >> generic "upload listener service" to just listen for uploads, separate >> from >> any specific form? >> >> Thanks for any help you can give. >> >> -MadDog >> >> >> -- >> View this message in context: >> http://www.nabble.com/Uploading-from-an-applet-tf3262636.html#a9068402 >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share >> your >> opinions on IT & business topics through brief surveys-and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ >> Wicket-user mailing list >> Wicket-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wicket-user >> > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > -- View this message in context: http://www.nabble.com/Uploading-from-an-applet-tf3262636.html#a9168448 Sent from the Wicket - User mailing list archive at Nabble.com. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user