You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ross Gardler <ro...@gardler.org> on 2005/09/12 01:00:08 UTC

Reloading a form after a time period

I have a Cocoon form that shows live test result data from a sensor 
connected via ethernet.

Currently the user refreshes the form manually by clicking a submit 
action button, which prompts the flowscript to determines whether the 
test has completed (send a new page) or whether the form should be 
redisplayed (send same page again).

I would like to refresh this form automatically after a defined period 
of time. What is the best wqay of doing this?

Ross

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Reloading a form after a time period

Posted by Ross Gardler <rg...@apache.org>.
Jason Johnston wrote:
> Mark Lundquist wrote:
> 
>>
>> On Sep 11, 2005, at 4:42 PM, Jason Johnston wrote:
>>
>>> You'll proabably also need to build the URL of the refresh to include 
>>> the continuation id, and the name of the refresh button as a request 
>>> parameter.
>>
>>
>>
>> Not if it's the resource you're already serving :-)
>> —ml—
> 
> 
> Right, of course.  But from Ross's description of his flow it sounded 
> like the form.showForm() loop was being exited during each refresh, 
> which would mean that if form.showForm() was called again it would use a 
> different continuation.  But without knowing for sure how the flow is 
> structured it's a guess either way.  Just trying to give as much 
> information as possible.

It's a multi-page form so a straight refresh won't do the trick (should 
have said I'd tried that and it refreshes back to the first form in the 
page).

However, adding the continuation to the refresh request did the trick, 
thanks.

Ross


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Reloading a form after a time period

Posted by Jason Johnston <co...@lojjic.net>.
Mark Lundquist wrote:
> 
> On Sep 11, 2005, at 4:42 PM, Jason Johnston wrote:
> 
>> You'll proabably also need to build the URL of the refresh to include 
>> the continuation id, and the name of the refresh button as a request 
>> parameter.
> 
> 
> Not if it's the resource you're already serving :-)
> —ml—

Right, of course.  But from Ross's description of his flow it sounded 
like the form.showForm() loop was being exited during each refresh, 
which would mean that if form.showForm() was called again it would use a 
different continuation.  But without knowing for sure how the flow is 
structured it's a guess either way.  Just trying to give as much 
information as possible.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Reloading a form after a time period

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Sep 11, 2005, at 4:42 PM, Jason Johnston wrote:

> You'll proabably also need to build the URL of the refresh to include 
> the continuation id, and the name of the refresh button as a request 
> parameter.

Not if it's the resource you're already serving :-)
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Reloading a form after a time period

Posted by Jason Johnston <co...@lojjic.net>.
Mark Lundquist wrote:
> 
> On Sep 11, 2005, at 4:00 PM, Ross Gardler wrote:
> 
>> I have a Cocoon form that shows live test result data from a sensor 
>> connected via ethernet.
>>
>> Currently the user refreshes the form manually by clicking a submit 
>> action button, which prompts the flowscript to determines whether the 
>> test has completed (send a new page) or whether the form should be 
>> redisplayed (send same page again).
>>
>> I would like to refresh this form automatically after a defined period 
>> of time. What is the best wqay of doing this?
> 
> 
> <html>
>     <head>
>         <meta http-equiv="refresh" content="30"/>
>         .

You'll proabably also need to build the URL of the refresh to include 
the continuation id, and the name of the refresh button as a request 
parameter.

<meta http-equiv="refresh" 
content="30;URL=#{$cocoon/continuation/id}.continue?refreshAction=1"/>

That assumes you're using JXTemplate of course.  If not then I'm not 
sure how you'd get the continuation id.  I suppose you could use 
client-side javascript.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Reloading a form after a time period

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Sep 11, 2005, at 4:00 PM, Ross Gardler wrote:

> I have a Cocoon form that shows live test result data from a sensor 
> connected via ethernet.
>
> Currently the user refreshes the form manually by clicking a submit 
> action button, which prompts the flowscript to determines whether the 
> test has completed (send a new page) or whether the form should be 
> redisplayed (send same page again).
>
> I would like to refresh this form automatically after a defined period 
> of time. What is the best wqay of doing this?

<html>
	<head>
		<meta http-equiv="refresh" content="30"/>
		.
		.


HTH,
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org