You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ashika Umanga Umagiliya <au...@biggjapan.com> on 2009/08/19 07:17:29 UTC
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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: Newbie question: fileupload AJAX progressbar ?
Posted by "Jing Ge (Besitec IT DEHAM)" <JG...@besitec.com>.
Hi,
Add this in your application class "SVRWebApplication":
@Override
protected WebRequest newWebRequest(HttpServletRequest servletRequest) {
return new UploadWebRequest(servletRequest);
}
Best regards!
Jing
-----Original Message-----
From: Ashika Umanga Umagiliya [mailto:aumanga@biggjapan.com]
Sent: Mittwoch, 19. August 2009 07:17
To: users@wicket.apache.org
Subject: 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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Newbie question: fileupload AJAX progressbar ?
Posted by Robin Sander <ro...@gmx.net>.
Hi,
I'm using Firefox 3.5.2 and the strange thing is that the live demo
works (progress bar shows progress)
and the same sources copied into my (wicket 1.4) app do not work
properly. (no progress shown)
That's why I asked for further requirements on the server side. I'm
using Glassfish V2, maybe the
container is messing things up? I will try it again with the new
wicket 1.4.1 and then with Tomcat
as a container...
On 20.08.2009, at 03:58, Ashika Umanga Umagiliya wrote:
> Hi Robin,
>
> Are you using Safari , I saw in following threads that its not
> working properly with Safari .
>
> http://www.nabble.com/UploadProgressBar-in-firefox-and-ie6-tp24166616p24205091.html
> http://www.nabble.com/UploadProgressBar-does-not-work-in-Safari-browser--to21571997.html#a24322943
>
> Regards
>
> Robin Sander wrote:
>>
>> I've just copied the example upload page from http://www.wicket-library.com/wicket-examples/upload/single
>> into my application with the same result: upload works but the
>> progess bar is NOT updated.
>>
>> So, anything else needed besides overriding 'newWebRequest()' ?
>> I'm using wicket, wicket-datetime and wicket-extensions, all in
>> version 1.4.0.
>> Do I need another wicket module? Maybe some kind of wicket-ajax ??
>>
>>
>>
>> On 19.08.2009, at 12:25, Robin Sander wrote:
>>
>>>
>>> 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:aumanga@biggjapan.com]
>>>> Gesendet: Mittwoch, 19. August 2009 09:10
>>>> An: users@wicket.apache.org
>>>> 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:aumanga@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-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Newbie question: fileupload AJAX progressbar ?
Posted by Ashika Umanga Umagiliya <au...@biggjapan.com>.
Hi Robin,
Are you using Safari , I saw in following threads that its not working
properly with Safari .
http://www.nabble.com/UploadProgressBar-in-firefox-and-ie6-tp24166616p24205091.html
http://www.nabble.com/UploadProgressBar-does-not-work-in-Safari-browser--to21571997.html#a24322943
Regards
Robin Sander wrote:
>
> I've just copied the example upload page from
> http://www.wicket-library.com/wicket-examples/upload/single
> into my application with the same result: upload works but the progess
> bar is NOT updated.
>
> So, anything else needed besides overriding 'newWebRequest()' ?
> I'm using wicket, wicket-datetime and wicket-extensions, all in
> version 1.4.0.
> Do I need another wicket module? Maybe some kind of wicket-ajax ??
>
>
>
> On 19.08.2009, at 12:25, Robin Sander wrote:
>
>>
>> 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:aumanga@biggjapan.com]
>>> Gesendet: Mittwoch, 19. August 2009 09:10
>>> An: users@wicket.apache.org
>>> 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:aumanga@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-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Newbie question: fileupload AJAX progressbar ?
Posted by Robin Sander <ro...@gmx.net>.
I've just copied the example upload page from http://www.wicket-library.com/wicket-examples/upload/single
into my application with the same result: upload works but the progess
bar is NOT updated.
So, anything else needed besides overriding 'newWebRequest()' ?
I'm using wicket, wicket-datetime and wicket-extensions, all in
version 1.4.0.
Do I need another wicket module? Maybe some kind of wicket-ajax ??
On 19.08.2009, at 12:25, Robin Sander wrote:
>
> 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:aumanga@biggjapan.com]
>> Gesendet: Mittwoch, 19. August 2009 09:10
>> An: users@wicket.apache.org
>> 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:aumanga@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-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Newbie question: fileupload AJAX progressbar ?
Posted by Robin Sander <ro...@gmx.net>.
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:aumanga@biggjapan.com]
> Gesendet: Mittwoch, 19. August 2009 09:10
> An: users@wicket.apache.org
> 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:aumanga@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-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: Newbie question: fileupload AJAX progressbar ?
Posted by Stefan Lindner <li...@visionet.de>.
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:aumanga@biggjapan.com]
Gesendet: Mittwoch, 19. August 2009 09:10
An: users@wicket.apache.org
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:aumanga@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Newbie question: fileupload AJAX progressbar ?
Posted by Ashika Umanga Umagiliya <au...@biggjapan.com>.
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:aumanga@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: Newbie question: fileupload AJAX progressbar ?
Posted by Stefan Lindner <li...@visionet.de>.
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:aumanga@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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org