You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by David Tekeshe <te...@paynet.co.zw> on 2004/02/24 08:21:16 UTC
Howto Display a Progress Page / Bar
How do I display a progress / please wait page? The following code snippet is not working.
Thanks in advance
// flow.js
// ...
cocoon.sendPage("html/wait.htm");
for(var row = 0; row < repeater.getSize(); row++)
{
var isSelected = repeater.getWidget(row, "select").getValue().booleanValue();
if (isSelected)
{
var msgId = repeater.getWidget(idx, "reference").getValue();
var xpath = "/msg/msg-id[text()='" + msgId + "']";
var dbxmlAdaptor = new Packages.zw.co.eswitch.adaptor.DBXMLAdaptor(xpath);
if (submitBtn == "auth1")
{
dbxmlAdaptor.update("status", "AUTH-2");
print("Message : " + msgId + " status changed to AUTH-2");
}
}
}
cocoon.sendPage("html/done.htm");
// ...
Re: Howto Display a Progress Page / Bar
Posted by Upayavira <uv...@upaya.co.uk>.
David,
I've just realised I was wrong in what I said - or rather, not quite
exact. It is simpler than I said.
What you do is immediately send back a page that says "wait..." and does
an immediate refresh to another page. This other page, when requested,
starts doing your slow processing. When finished, it displays the
answer. It can take a while to load, and in the meanwhile, the temporary
"wait" page shows.
Regards, Upayavira
David Tekeshe wrote:
>Thanks Upayavira,
>
>I had taken a break. Let me immerse myself in it & will let you know how it
>goes.
>
>Thanks for the automatic refresh trick - I haven't thought of it - I'm going
>to do some research / implementation in the next two days or so. I would
>have been nice to grab a quick example.
>
>David Tekeshe
>
>----- Original Message -----
>From: "Upayavira" <uv...@upaya.co.uk>
>To: <us...@cocoon.apache.org>
>Sent: Tuesday, February 24, 2004 11:27 AM
>Subject: Re: Howto Display a Progress Page / Bar
>
>
>
>
>>David Tekeshe wrote:
>>
>>
>>
>>>How do I display a progress / please wait page? The following code
>>>snippet is not working.
>>>
>>>Thanks in advance
>>>
>>>// flow.js
>>>
>>>// ...
>>>
>>>cocoon.sendPage("html/wait.htm");
>>>
>>>for(var row = 0; row < repeater.getSize(); row++)
>>>{
>>> var isSelected = repeater.getWidget(row,
>>>"select").getValue().booleanValue();
>>> if (isSelected)
>>> {
>>> var msgId = repeater.getWidget(idx, "reference").getValue();
>>> var xpath = "/msg/msg-id[text()='" + msgId + "']";
>>> var dbxmlAdaptor = new
>>>Packages.zw.co.eswitch.adaptor.DBXMLAdaptor(xpath);
>>> if (submitBtn == "auth1")
>>> {
>>> dbxmlAdaptor.update("status", "AUTH-2");
>>> print("Message : " + msgId + " status changed to AUTH-2");
>>> }
>>> }
>>>}
>>>
>>>cocoon.sendPage("html/done.htm");
>>>
>>>/
>>>
>>>
>>>
>>No. Of course that wouldn't. Firstly, you need to use sendPagaAndWait()
>>in order for processing to continue. Secondly, the processing continues
>>when the user has submitted the page you've sent, not as soon as the
>>page has been sent.
>>
>>To do this, what you'd have to do is initiate a background process to do
>>the calculation, send them a page that says "please wait", and has an
>>automatic refresh <meta> tag, set to, say, 2 seconds, pointing at a
>>second page. This second page, when loaded, then collects the results of
>>the background process.
>>
>>I'm afraid, as far as I can see, there's no easy way to get around this
>>using Flow.
>>
>>But I'd be delighted to be corrected.
>>
>>Regards, Upayavira
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Howto Display a Progress Page / Bar
Posted by David Tekeshe <te...@paynet.co.zw>.
Thanks Upayavira,
I had taken a break. Let me immerse myself in it & will let you know how it
goes.
Thanks for the automatic refresh trick - I haven't thought of it - I'm going
to do some research / implementation in the next two days or so. I would
have been nice to grab a quick example.
David Tekeshe
----- Original Message -----
From: "Upayavira" <uv...@upaya.co.uk>
To: <us...@cocoon.apache.org>
Sent: Tuesday, February 24, 2004 11:27 AM
Subject: Re: Howto Display a Progress Page / Bar
> David Tekeshe wrote:
>
> > How do I display a progress / please wait page? The following code
> > snippet is not working.
> >
> > Thanks in advance
> >
> > // flow.js
> >
> > // ...
> >
> > cocoon.sendPage("html/wait.htm");
> >
> > for(var row = 0; row < repeater.getSize(); row++)
> > {
> > var isSelected = repeater.getWidget(row,
> > "select").getValue().booleanValue();
> > if (isSelected)
> > {
> > var msgId = repeater.getWidget(idx, "reference").getValue();
> > var xpath = "/msg/msg-id[text()='" + msgId + "']";
> > var dbxmlAdaptor = new
> > Packages.zw.co.eswitch.adaptor.DBXMLAdaptor(xpath);
> > if (submitBtn == "auth1")
> > {
> > dbxmlAdaptor.update("status", "AUTH-2");
> > print("Message : " + msgId + " status changed to AUTH-2");
> > }
> > }
> > }
> >
> > cocoon.sendPage("html/done.htm");
> >
> > /
> >
> No. Of course that wouldn't. Firstly, you need to use sendPagaAndWait()
> in order for processing to continue. Secondly, the processing continues
> when the user has submitted the page you've sent, not as soon as the
> page has been sent.
>
> To do this, what you'd have to do is initiate a background process to do
> the calculation, send them a page that says "please wait", and has an
> automatic refresh <meta> tag, set to, say, 2 seconds, pointing at a
> second page. This second page, when loaded, then collects the results of
> the background process.
>
> I'm afraid, as far as I can see, there's no easy way to get around this
> using Flow.
>
> But I'd be delighted to be corrected.
>
> Regards, Upayavira
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Howto Display a Progress Page / Bar
Posted by Upayavira <uv...@upaya.co.uk>.
David Tekeshe wrote:
> How do I display a progress / please wait page? The following code
> snippet is not working.
>
> Thanks in advance
>
> // flow.js
>
> // ...
>
> cocoon.sendPage("html/wait.htm");
>
> for(var row = 0; row < repeater.getSize(); row++)
> {
> var isSelected = repeater.getWidget(row,
> "select").getValue().booleanValue();
> if (isSelected)
> {
> var msgId = repeater.getWidget(idx, "reference").getValue();
> var xpath = "/msg/msg-id[text()='" + msgId + "']";
> var dbxmlAdaptor = new
> Packages.zw.co.eswitch.adaptor.DBXMLAdaptor(xpath);
> if (submitBtn == "auth1")
> {
> dbxmlAdaptor.update("status", "AUTH-2");
> print("Message : " + msgId + " status changed to AUTH-2");
> }
> }
> }
>
> cocoon.sendPage("html/done.htm");
>
> /
>
No. Of course that wouldn't. Firstly, you need to use sendPagaAndWait()
in order for processing to continue. Secondly, the processing continues
when the user has submitted the page you've sent, not as soon as the
page has been sent.
To do this, what you'd have to do is initiate a background process to do
the calculation, send them a page that says "please wait", and has an
automatic refresh <meta> tag, set to, say, 2 seconds, pointing at a
second page. This second page, when loaded, then collects the results of
the background process.
I'm afraid, as far as I can see, there's no easy way to get around this
using Flow.
But I'd be delighted to be corrected.
Regards, Upayavira
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org