You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Fernando Wermus <fe...@gmail.com> on 2010/04/08 20:58:58 UTC
Re: How to give feedback in long-running operation within
AjaxButton.onSubmit()?
Does this resolve your problem?
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
private static final long serialVersionUID = 1L;
@Override
public CharSequence decorateScript(CharSequence script) {
return YOUR JAVASCRIPT + script;
}
};
}
On Thu, Apr 8, 2010 at 3:43 PM, Thomas Götz <to...@richmountain.de> wrote:
> Problem:
> I have an AjaxButton that triggers a long-running operation when clicked. I
> want to give feedback (in form of a javascript message) upon partial
> completion of the operation, therefore I am using a jQuery notifications
> plugin (http://www.programmingmind.com/contributions).
>
> So, what I do is the following:
>
> final Form form = new Form("form");
> add(form);
>
> form.add(new AjaxButton("button) {
> @Override
> protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
> for(Object o : someList) {
> // do somthing
> target.appendJavascript(getJavascript());
> }
> target.addComponent(form);
> }
> });
>
>
> ... but obviously, the Javascript messages are only display at the end of
> the complete operation (after foreach loop has finished). So my question:
> what should I do to get the messages displayed after each iteration?
>
> -Tom
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Fernando Wermus.
www.linkedin.com/in/fernandowermus
Re: How to give feedback in long-running operation within
AjaxButton.onSubmit()?
Posted by Nishant Neeraj <ni...@gmail.com>.
I think you may look into this package
org.apache.wicket.extensions.ajax.markup.html.form.upload where upload
progress-bar is implemented. You may do something like this.
So, probably it sets a resource in session, Java part regularly updates the
string resource. And JS keeps on polling this resource by using the URL to
the resource provided to JS initializer and renders on UI. Anyone can
correct me, if I am wrong.
Just a suggestion. I am naive to Wicket.
- Nishant
On Fri, Apr 9, 2010 at 2:25 AM, Thomas Götz <to...@richmountain.de> wrote:
> I fear not. As far as I understand, getAjaxCallDecorator() decorates the
> javascript with a custom script, which is executed immediately upon hitting
> the button. What I want to achieve is displaying some status messaged during
> the progress of my long-term operation ...
>
> -Tom
>
>
> On 08.04.2010 at 20:58 Fernando Wermus wrote:
>
> > Does this resolve your problem?
> >
> > @Override
> >
> > protected IAjaxCallDecorator getAjaxCallDecorator() {
> >
> > return new AjaxCallDecorator() {
> >
> > private static final long serialVersionUID = 1L;
> >
> > @Override
> >
> > public CharSequence decorateScript(CharSequence script) {
> >
> > return YOUR JAVASCRIPT + script;
> >
> > }
> >
> > };
> >
> > }
> >
> > On Thu, Apr 8, 2010 at 3:43 PM, Thomas Götz <to...@richmountain.de> wrote:
> >
> >> Problem:
> >> I have an AjaxButton that triggers a long-running operation when
> clicked. I
> >> want to give feedback (in form of a javascript message) upon partial
> >> completion of the operation, therefore I am using a jQuery notifications
> >> plugin (http://www.programmingmind.com/contributions).
> >>
> >> So, what I do is the following:
> >>
> >> final Form form = new Form("form");
> >> add(form);
> >>
> >> form.add(new AjaxButton("button) {
> >> @Override
> >> protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
> >> for(Object o : someList) {
> >> // do somthing
> >> target.appendJavascript(getJavascript());
> >> }
> >> target.addComponent(form);
> >> }
> >> });
> >>
> >>
> >> ... but obviously, the Javascript messages are only display at the end
> of
> >> the complete operation (after foreach loop has finished). So my
> question:
> >> what should I do to get the messages displayed after each iteration?
> >>
> >> -Tom
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > Fernando Wermus.
> >
> > www.linkedin.com/in/fernandowermus
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: How to give feedback in long-running operation within AjaxButton.onSubmit()?
Posted by Thomas Götz <to...@richmountain.de>.
I fear not. As far as I understand, getAjaxCallDecorator() decorates the javascript with a custom script, which is executed immediately upon hitting the button. What I want to achieve is displaying some status messaged during the progress of my long-term operation ...
-Tom
On 08.04.2010 at 20:58 Fernando Wermus wrote:
> Does this resolve your problem?
>
> @Override
>
> protected IAjaxCallDecorator getAjaxCallDecorator() {
>
> return new AjaxCallDecorator() {
>
> private static final long serialVersionUID = 1L;
>
> @Override
>
> public CharSequence decorateScript(CharSequence script) {
>
> return YOUR JAVASCRIPT + script;
>
> }
>
> };
>
> }
>
> On Thu, Apr 8, 2010 at 3:43 PM, Thomas Götz <to...@richmountain.de> wrote:
>
>> Problem:
>> I have an AjaxButton that triggers a long-running operation when clicked. I
>> want to give feedback (in form of a javascript message) upon partial
>> completion of the operation, therefore I am using a jQuery notifications
>> plugin (http://www.programmingmind.com/contributions).
>>
>> So, what I do is the following:
>>
>> final Form form = new Form("form");
>> add(form);
>>
>> form.add(new AjaxButton("button) {
>> @Override
>> protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
>> for(Object o : someList) {
>> // do somthing
>> target.appendJavascript(getJavascript());
>> }
>> target.addComponent(form);
>> }
>> });
>>
>>
>> ... but obviously, the Javascript messages are only display at the end of
>> the complete operation (after foreach loop has finished). So my question:
>> what should I do to get the messages displayed after each iteration?
>>
>> -Tom
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org