Hi,

are there any further requirements? I use Wicket 1.4.0, defined 'newWebRequest' in my Application class and though I do see a progress bar and the upload works perfectly
I do not see any progress! (the bar never changes)
Is the progress automatically reported by the server side or do I have to implement
something or add/modify some Javascript?

Robin.


On 19.08.2009, at 09:19, Stefan Lindner wrote:

Hi Ashika,

I pointed yopu tot he documentation because I was not sure if using UploadWebRequest has any side effects. Does not seem so.

Stefan

-----Ursprüngliche Nachricht-----
Von: Ashika Umanga Umagiliya [mailto:[email protected]]
Gesendet: Mittwoch, 19. August 2009 09:10
An: [email protected]
Betreff: Re: Newbie question: fileupload AJAX progressbar ?

Thanks Stefan,

That solved my problem.
Since UploadProgreeBar is a component of 'wicket-extensions', i refered documentation at http://www.wicketframework.org/wicket-extensions/ which
is kind of updated (versoin 1.2) . I had to download documentation for
1.4 from the maven repository.

Thanks again.

Stefan Lindner wrote:
You need

        @Override
protected WebRequest newWebRequest(HttpServletRequest servletRequest) {
                return new UploadWebRequest(servletRequest);
        }

In your Application's class. I think you should definitly read the APIdoc (see UploadProgressBar)!

Stefan

-----Ursprüngliche Nachricht-----
Von: Ashika Umanga Umagiliya [mailto:[email protected]]
Gesendet: Mittwoch, 19. August 2009 07:17
An: [email protected]
Betreff: Newbie question: fileupload AJAX progressbar ?

Greetings all,

I am new to Wicket and I used 'UploadProgressBar' to create an AJAX
brogressbar for fileupload.(refered example at wicket-library.org )
But when uploading a file, eventhough progreebar showed,theres no
activity nor incrementation of the bar
I have posted my code, what could be the problem?

Thanks in advance.




public class UploadPage extends WebPage {

   ///fileupload form
   private class FileUploadForm extends Form<Void>{

       private FileUploadField fileuploadField;
       public FileUploadForm(String name){
           super(name);
           setMultiPart(true);
           add(fileuploadField=new FileUploadField("fileInput"));
           setMaxSize(Bytes.gigabytes(4));

       }
       @Override
       protected void onSubmit() {
final FileUpload upload = fileuploadField.getFileUpload();
               if (upload != null)
               {

                   File newFile = new File(getUploadFolder(),
upload.getClientFileName());

                   try
                   {
                        newFile.createNewFile();
                       upload.writeTo(newFile);

                       UploadPage.this.info("saved file: " +
upload.getClientFileName());
                   }
                   catch (Exception e)
                   {
throw new IllegalStateException("Unable to write
file");
                   }
               }
       }

   }


   public UploadPage(final PageParameters parameters) {
       final FeedbackPanel uploadFfeedback=new
FeedbackPanel("uploadFeedback");
       add(uploadFfeedback);

       final FileUploadForm fileUploadForm=new
FileUploadForm("ajaxupload");
       fileUploadForm.add(new UploadProgressBar("progress",
fileUploadForm));
       add(fileUploadForm);
   }


   private Folder getUploadFolder(){
       return
((SVRWebApplication)Application.get()).getUploadFolder();
   }


}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to