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:auma...@biggjapan.com]
Gesendet: Mittwoch, 19. August 2009 07:17
An: users@wicket.apache.org
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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org