There ~will~ be more features like this soon, have been on the tail end of a
"rent paying" project release and haven't had time for anything else...

I'm not sure polling is the perfect answer (at least done this way.) You
might check out cometd.org as well. The dojo + jetty guys have been working
together to make this a lot easier for servlet based apps.

One of many "to dos" I plan on adding to tapestry at some point..(probably a
sub project, but will likely happen sooner than later as it seems lots of
people want this)

On 9/6/06, livelock <[EMAIL PROTECTED]> wrote:


Yay, it works, thanks. It really looks like there should be a more elegant
solution to this, but hey, it works.

Now I am facing a different thing, using AJAX requests I only want to
transfer deltas. For example if there are 11 rows on the screen and on the
next update there is a new one, I don't want to transfer 12 rows then,
only
one and add it to the other rows.
Is there an elegant way? Or do I have to create component instances
dynamically?

Regards


Josh Long wrote:
>
> The following is contrived, but works. Mainly, I would create a proper
> dojo widget and have the event listener bind to that, but this works
> because of expando properties...
>
> In your body of a file called Test.html, I have
>
>
>     <div id ="test"></div>
>
>          <script type="text/javascript" >
>               dojo.require('dojo.lang.*');
>               dojo.require('dojo.event.*')
>             var tst =dojo.byId('test');
>
>                     tst.update=function()
>                       {
>                           dojo.debug ('running')
>                           dojo.lang.setTimeout( tst.update , 4000) ;
> // im sure ther animation package had
> //a proper way of scheduling something for repeating, but...
>                       };
>
>             dojo.addOnLoad(function(){
>                dojo.byId('test').update() ; // get the ball rolling
>             });
>          </script>
>
>     <div jwcid="[EMAIL PROTECTED]">
>               <span jwcid="@Insert" value = "ognl: now">
>               the current time is
>               </span>
>         </div>
>
>
> then in Test.java,
>
>
>     abstract public Date getNow() ;
>     abstract public void setNow(Date now) ;
>
>     @EventListener( elements ="test", async = true ,
>                     events ="update")
>     public void update (IRequestCycle cycle )
>     {
>         setNow(new Date()) ;
>         cycle.getResponseBuilder().updateComponent("status");
>    }
>
>
> and boom!
>
> As you load hte page in javascript, test.update gets called which in
> turn causes the server side event listener to run. The event listener
> updates the clock (every 4 seconds because I was running this in devel
> mode and, and I mean nothing, pisses tapestry off more than running in
> devel mode) and the page reflects it without any refresh.
>
> Hope this helps, sort of...
>
> Josh
>
> On 9/3/06, livelock <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>> Dojo got a polling mode
>> (
http://archive.dojotoolkit.org/nightly/tests/io/test_ScriptSrcIO.html#CommonArgs
).
>> How do I use that properly with Tapestry 4.1? The EventListener seems
not
>> have anything that ge
>>
>> I want a component that reads a property from a server all 4 seconds.
For
>> example for stock quotes or even a chat.
>>
>> Regards,
>> André
>> --
>> View this message in context:
>>
http://www.nabble.com/How-to-implement-polling-with-%40EventListener-tf2212501.html#a6127728
>> Sent from the Tapestry - User forum at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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]
>
>
>

--
View this message in context:
http://www.nabble.com/How-to-implement-polling-with-%40EventListener-tf2212501.html#a6170249
Sent from the Tapestry - User forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

Reply via email to