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 <t...@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 <t...@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-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > Fernando Wermus.
> >
> > www.linkedin.com/in/fernandowermus
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to