<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>I'm developing an app utilizing Comet quite extensively (coupled with Ajax).<br><br>I have gotten what I want to work and all at a basic level, but I do have a couple questions since I'm not at all familiar with the technology.<br><br>The first is, how do the pushers work? I tried throwing references to one around to just one, but I think it actually needs to be rendered to the page (load script) as per the example.<br><br>And the last one for now ;) is how can I restrict relevent data to the sessions that "care" about it? If a client pushes some javascript, but only a few other clients need that javascript, I would prefer to only give that script to those clients, or am I thinking on the wrong lines here?<br>Should I do something more along the lines of the CTCounter example where, when something in the data structure changes, then the clients can choose to do something about it?<br><br>Thanks!<br>RS<br><br><hr>From: dtrussardi@tiscali.it<br>Date: Sat, 20 Mar 2010 12:48:53 +0100<br>To: seaside@lists.squeakfoundation.org<br>CC: dario.trussardi@tiscali.it<br>Subject: [Seaside] Re: SUComponent script: question<br><br>
<meta http-equiv=Content-Type content="text/html; charset=unicode">
<meta name=Generator content="Microsoft SafeHTML"><span class=ecxApple-style-span style="font-family:Times"><pre>Hi Lukas,</pre><pre>in the attachment you find the class TestScript.</pre><pre>You can open it directly from seaside browser page link.</pre><pre>After&nbsp;with the browser inspector, you can explore the 'officeLayer' data.</pre><pre>You found :</pre><pre><span class=ecxApple-style-span style="font-family:monospace, sans-serif;white-space:pre-wrap">[<span class=ecxconsole-formatted-object style="display:inline-block;vertical-align:top"><div class="ecxsection ecxexpanded" style="margin-right:0px !important;margin-bottom:1px;margin-left:12px !important"><div class=ecxheader style="padding-top:0px;padding-right:8px;padding-bottom:0px;padding-left:0px;border-top-width:1px;border-top-style:none;border-top-color:rgb(145, 160, 192);background-image:none;min-height:0px;white-space:nowrap;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial"><div class=ecxsubtitle style="float:right;font-size:10px;margin-left:5px;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden"></div><div class=title style="color:black;font-weight:normal;word-wrap:break-word;white-space:normal">Object</div></div><ol class=ecxproperties style="padding-left:6px;display:block;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:2px;padding-right:6px;padding-bottom:3px;list-style-type:none;list-style-position:initial;list-style-image:initial;background-color:white"><li title="" class=ecxparent style="margin-left:1px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden;cursor:auto"><span class=ecxname style="color:rgb(136, 19, 145)">places</span>:&nbsp;<span class=ecxvalue style="">Array</span></li><li title="" class="ecxparent ecxexpanded" style="margin-left:1px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden;cursor:auto"><span class=ecxname style="color:rgb(136, 19, 145)">zoom</span>:&nbsp;<span class=ecxvalue style="">Array</span></li><ol class="ecxchildren ecxexpanded" style="display:block;margin-right:0px;margin-bottom:0px;margin-left:0px;list-style-type:none;list-style-position:initial;list-style-image:initial"><li title="" style="margin-left:12px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden;cursor:auto"><span class=ecxname style="color:rgb(136, 19, 145)">0</span>:&nbsp;<span class=ecxvalue style="">0</span></li><li title="" style="margin-left:12px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden;cursor:auto"><span class=ecxname style="color:rgb(136, 19, 145)">1</span>:&nbsp;<span class=ecxvalue style="">3</span></li></ol></ol></div></span>, <span class=ecxconsole-formatted-object style="display:inline-block;vertical-align:top"><div class=ecxsection style="margin-right:0px !important;margin-bottom:1px;margin-left:12px !important"><div class=ecxheader style="padding-top:0px;padding-right:8px;padding-bottom:0px;padding-left:0px;border-top-width:1px;border-top-style:none;border-top-color:rgb(145, 160, 192);background-image:none;min-height:0px;white-space:nowrap;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial"><div class=ecxsubtitle style="float:right;font-size:10px;margin-left:5px;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden"></div><div class=title style="color:black;font-weight:normal;word-wrap:break-word;white-space:normal">Object</div></div></div></span>]</span></pre><pre><br></pre><pre>Now add at SUAlTests initialize the new link:</pre><pre><span class=ecxApple-tab-span style="white-space:pre">        initialize
        super initialize.
        tabs := OrderedCollection new
                add: 'Welcome' -&gt; (Array
                        with: 'Welcome' -&gt; SUWelcomeTest new
                        with: 'Counter' -&gt; SUCounterTest new);
                add: 'Ajax' -&gt; (Array
                        with: 'Updater' -&gt; SUUpdaterTest new
                        with: 'Periodical' -&gt; SUPeriodicalTest new
                        with: 'Evaluator' -&gt; SUEvaluatorTest new);
                
                        with: 'Morph' -&gt; SUMorphTest new);</span></pre><pre><span class=ecxApple-tab-span style="white-space:pre">        </span>..........</pre><pre><span class=ecxApple-tab-span style="white-space:pre">        </span>.........</pre><pre><span class=ecxApple-tab-span style="white-space:pre">        </span>.........</pre><pre><span class=ecxApple-tab-span style="white-space:pre">
                add: 'testDTR' -&gt; (Array 
                        with: 'test' -&gt; TestScript new );
                 yourself.</span></pre><pre><span class=ecxApple-tab-span style="white-space:pre">
        selected := tabs first value</span></pre><pre>When you open the new scriptaculous entry and inspector the 'officeLayer' data, you find some other data:</pre><pre><span class=ecxApple-style-span style="font-family:monospace, sans-serif;white-space:pre-wrap"><div class=ecxheader style="padding-top:0px;padding-right:8px;padding-bottom:0px;padding-left:0px;border-top-width:1px;border-top-style:none;border-top-color:rgb(145, 160, 192);background-image:none;min-height:0px;white-space:nowrap;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial"><div class=title style="color:black;font-weight:normal;word-wrap:break-word;white-space:normal">Object</div></div><ol class=ecxproperties style="padding-left:6px;display:block;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:2px;padding-right:6px;padding-bottom:3px;list-style-type:none;list-style-position:initial;list-style-image:initial;background-color:white"><li title="" class=ecxparent style="margin-left:1px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden;cursor:auto"><span class=ecxname style="color:rgb(136, 19, 145)">places</span>:&nbsp;<span class=ecxvalue style="">Array</span></li><li title="" class="ecxparent ecxexpanded" style="margin-left:1px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden;cursor:auto"><span class=ecxname style="color:rgb(136, 19, 145)">zoom</span>:&nbsp;<span class=ecxvalue style="">Array</span></li><ol class="ecxchildren ecxexpanded" style="display:block;margin-right:0px;margin-bottom:0px;margin-left:0px;list-style-type:none;list-style-position:initial;list-style-image:initial"><li title="" class=ecxselected style="margin-left:12px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden;cursor:auto"><span class=ecxname style="color:rgb(136, 19, 145)">0</span>:&nbsp;<span class=ecxvalue style="">0</span></li><li title="" style="margin-left:12px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden;cursor:auto"><span class=ecxname style="color:rgb(136, 19, 145)">1</span>:&nbsp;<span class=ecxvalue style="">3</span></li><li title="" class=ecxparent style="margin-left:1px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden;cursor:auto"><span class=ecxname style="color:rgb(136, 19, 145)">_each</span>:&nbsp;<span class=ecxvalue style="">function forEach() {</span></li><li title="" class=ecxparent style="margin-left:1px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden;cursor:auto"><span class=ecxname style="color:rgb(136, 19, 145)">_reverse</span>:&nbsp;<span class=ecxvalue style="">function reverse() {</span></li><li title="" class=ecxparent style="margin-left:1px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden;cursor:auto"><span class=ecxname style="color:rgb(136, 19, 145)">all</span>:&nbsp;<span class=ecxvalue style="">function (C, B) {C=C?C.bind(B):Prototype.K;var A=true;this.each(function(E,D){A=A&amp;&amp;!!C(E,D);if(!A){throw $break}});return A;}</span></li><li title="" class=ecxparent style="margin-left:1px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden;cursor:auto"><span class=ecxname style="color:rgb(136, 19, 145)">any</span>:&nbsp;<span class=ecxvalue style="">function (C, B) {C=C?C.bind(B):Prototype.K;var A=false;this.each(function(E,D){if(A=!!C(E,D)){throw $break}});return A;}</span></li><li title="" class=ecxparent style="margin-left:1px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;overflow-y:hidden;cursor:auto"><span class=ecxname style="color:rgb(136, 19, 145)">clear</span></li></ol></ol></span><div><br></div><div>And it's the problem.</div><div><br></div><div>Thanks,</div><div><br></div><div><span class=ecxApple-tab-span style="white-space:pre">        </span>Dario</div><div><br></div><div><br></div><div></div></pre></span>                                               <br /><hr />Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. <a href='http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_1' target='_new'>Learn More.</a></body>
</html>