I believe its because your submit button is getting hooked up with the
Button("ok") instead and not the AjaxForm-Submit..i wouldnt define the
Button on the page-component and similarly would remove wicket:id = "ok"
from the tag..
Haritha Juturu wrote:
>
> Hi Everyone
> I'm trying to upload a file using AjaxFormSubmitBehavior .
> When i submit the form , the defined onSubmit() method is not being
> called. Can anyone tell me why this is happening ?
> Code given below:
> Java code is :
> Form f = new Form("f");
> f.setOutputMarkupId(true);
> f.setMultiPart(true);
> f.setMaxSize(Bytes.MAX);
> f.add(upload = new FileUploadField("fileInput"));
> f.add(new Button("ok"));
> f.add(new AjaxFormSubmitBehavior("onsubmit") {
> protected void onSubmit(AjaxRequestTarget target) {
> log.debug("inside onSubmit");
> FileUpload fileUpload = upload.getFileUpload();
> log.debug(fileUpload.getBytes());
> }
>
> @Override
> protected void onError(AjaxRequestTarget arg0) {
> // TODO Auto-generated method stub
> }
> });
>
> add(f);
> }
>
>
> Form in the html file is :
>
> <form id="uploadForm" wicket:id="f">
> <fieldset>
> <div>
> <input type="file" wicket:id="fileInput"/>
> <input wicket:id="ok" type="submit" value="Upload!"/>
> </div>
> </fieldset>
> </form>
>
> Thanks
> Haritha
>
>
>
>
>
> ____________________________________________________________________________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now.
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
>
--
View this message in context:
http://www.nabble.com/Unable-to-Upload-file-using-AjaxFormSubmitBehavior-tp14747634p14747752.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]