the proper way to do this would be:

class mypage extends webpage {

  private reportconfig config;
  public mypage {
    config=....;

    add(new ajaxpoller("poller") {
           protected void onpoll(ajaxrequesttarget t) {
                 if (getapplication().getworkmanager().isready(config)) {

t.appendjavascript("window.location='reportstreamer/"+config.getuuid();+"';");
                 } else {
                      // whatever ui update
                 }
            }
     }
  }
   protected void onbeforerender() {
          getapplication().getworkmanager().start(config);
          super.onbeforerender();
     }
}

there is no point streaming huge amounts of data through wicket,
servlets do a much better job.

code for ajax poller should be somewhere in archives but its pretty
easy to build yourself.

-igor

On Fri, Oct 31, 2008 at 10:12 AM, Adriano dos Santos Fernandes
<[EMAIL PROTECTED]> wrote:
> Hi!
>
> AFAIK, processing for ResourceStreamRequestTarget is not synchronized, so I
> can have more than one running in the same session. But due to my other
> problem, I had to wrap it on a Page to redirect. But that suspend user
> interaction until a report is completed, a thing that I don't want.
>
> So I'm now generating (nothing depends on Wicket) the report in a new thread
> started on the Page constructor and when that thread finalizes it puts the
> report on a variable of the Page. Meanwhile, there is a
> AbstractAjaxTimerBehavior verifying when that variable is not null to create
> the ResourceStreamRequestTarget and do the redirection.
>
> This works, but only when I'm doing nothing except waiting for the report
> completion. Is it due to when any other request happens the original page is
> serialized and the running thread updates the old one, and the timer acts on
> the new deserialized page?
>
> Is there a way to do background work like I want?
>
> Thanks,
>
>
> Adriano
>
>
> ---------------------------------------------------------------------
> 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