[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: T4 AJAX Timer Updates Problems
From:       Norman Franke <norman () myasd ! com>
Date:       2008-09-29 18:25:53
Message-ID: 30ECB75D-9168-4AC5-B617-6127DEC28F6A () myasd ! com
[Download RAW message or body]

Turns out one needs quotes around the "document.timer()" statement,  
otherwise it tries to execute the function in the call to set the  
timer. Perhaps a better error message could be provided? I think that  
Tapestry hadn't yet registered the form which led to the error.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Sep 29, 2008, at 11:14 AM, Norman Franke wrote:

> Same error: "this.forms[formId] is undefined" in dojo.js
>
> Norman Franke
> Answering Service for Directors, Inc.
> www.myasd.com
>
> On Sep 26, 2008, at 7:13 PM, Andreas Andreou wrote:
>
>> try
>>
>> document.timer = function() {
>>      tapestry.form.submitAsync("update");
>>      setTimeout(document.timer, 5000);
>> }
>> setTimeout(document.timer, 5000);
>>
>> On Sat, Sep 27, 2008 at 1:58 AM, Norman Franke <norman@myasd.com>  
>> wrote:
>>> I'm using Tapestry 4.1.2 and I'm attempting to get a JavaScript  
>>> timer to
>>> periodically refresh a block on my page. This is that block:
>>>
>>> Page load time: <span jwcid="@Insert" value="ognl:value">Value</ 
>>> span>
>>>
>>> <form jwcid="update@Form" updateComponents="updateDiv" async="true">
>>>
>>> <div jwcid="updateDiv@Any">
>>>      Refreshed time: <span jwcid="@Insert"  
>>> value="ognl:value">Value</span>
>>> </div>
>>>
>>> <input jwcid="@Submit" value="Update"/>
>>> </form>
>>> <SCRIPT language="JavaScript">
>>> dojo.require("tapestry.form");
>>>
>>> function timer() {
>>>      tapestry.form.submitAsync("update");
>>>      setTimeout(timer(), 5000);
>>> }
>>> setTimeout(timer(), 5000);
>>> </SCRIPT>
>>>
>>> The problem is this doesn't work. It gets an error  
>>> "this.forms[formId] is
>>> undefined". I tried a few other things, which resulted in  
>>> recursion errors
>>> (Firefox 3).
>>>
>>> How can I do this?
>>>
>>> Norman Franke
>>> Answering Service for Directors, Inc.
>>> www.myasd.com
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>>
>> -- 
>> Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
>> Tapestry / Tacos developer
>> Open Source / JEE Consulting
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>



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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic