<html><head></head><body><div class="ydp7928c542yahoo-style-wrap" style="font-family:lucida console, sans-serif;font-size:13px;"><div></div>
        <div dir="ltr" data-setdir="false">Cool, that is good to know. I always assumed that the block order was registered and used that way. </div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Bob</div><div><br></div>
        
        </div><div id="yahoo_quoted_7518836211" class="yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Thursday, October 27, 2022 at 01:26:30 p.m. EDT, Johan Brichau <johan@inceptive.be> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="yiv0011550802"><div>Hi Bob,<div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div class="yiv0011550802">Good to hear it works out.</div><div class="yiv0011550802">Just a note: the order in which you send the `script:` and `callback:value:` (or `callback:passenger:`) blocks to the JQAjax instance does not matter. Seaside will always invoke the `script:` block last since it is the primary callback that generates a response.</div><div class="yiv0011550802">The following message orders are equivalent:</div><div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div class="yiv0011550802"><div class="yiv0011550802">| value |</div><div class="yiv0011550802">html button</div><div class="yiv0011550802">   passenger: self;</div><div class="yiv0011550802">   onClick: (html jQuery ajax </div><div class="yiv0011550802">       script: [ :s | ...value is the passenger, which in this case is self… ];</div></div><div class="yiv0011550802">       callback: [ :v | value := v ] passenger: (html jQuery this)</div><div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div class="yiv0011550802"><div class="yiv0011550802">| value |</div><div class="yiv0011550802">html button</div><div class="yiv0011550802">   passenger: self;</div><div class="yiv0011550802">   onClick: (html jQuery ajax </div><div class="yiv0011550802">       callback: [ :v | value := v ] passenger: (html jQuery this);</div><div class="yiv0011550802">       script: [ :s | ...value is the passenger, which in this case is self… ]</div></div><div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div class="yiv0011550802"><br clear="none" class="yiv0011550802"><div><br clear="none" class="yiv0011550802"><blockquote type="cite" class="yiv0011550802"><div id="yiv0011550802yqt48085" class="yiv0011550802yqt5406383101"><div class="yiv0011550802">On 26 Oct 2022, at 13:26, Bob Nemec <<a rel="nofollow noopener noreferrer" shape="rect" ymailto="mailto:bobn@rogers.com" target="_blank" href="mailto:bobn@rogers.com" class="yiv0011550802">bobn@rogers.com</a>> wrote:</div><br clear="none" class="yiv0011550802Apple-interchange-newline"><div class="yiv0011550802"><div class="yiv0011550802"><div style="font-family:lucida console, sans-serif;font-size:13px;" class="yiv0011550802ydpe16e7e8fyahoo-style-wrap"><div class="yiv0011550802"></div>
        <div dir="ltr" class="yiv0011550802">For those that don't follow Discord, Johan provided a solution with an example that works for me.<br clear="none" class="yiv0011550802">What I needed to position the script: block after the callback:value: block, and have the callback:value: set state that the script: block could use. <br clear="none" class="yiv0011550802">Seems obvious now... </div><div dir="ltr" class="yiv0011550802"><br clear="none" class="yiv0011550802"><span class="yiv0011550802">The "script:value:" you are looking for is really the combination of a "callback:value:" with a "script:" on the same ajax request. You can pass the 'closest div passenger' to the script block using temporary variables that get assigned in the callback:value: or callback:passenger: block and then use those in the script: block. If you want to see some example combinations with event delegation you are referring to, you can check out the Todo example: </span><a rel="nofollow noopener noreferrer" shape="rect" target="_blank" href="https://github.com/SeasideSt/Seaside/blob/master/repository/Seaside-Examples.package/WATodo.class/instance/renderTodosOn..st" class="yiv0011550802">https://github.com/SeasideSt/Seaside/blob/master/repository/Seaside-Examples.package/WATodo.class/instance/renderTodosOn..st</a><br clear="none" class="yiv0011550802"></div>
        
        </div><div id="yiv0011550802yahoo_quoted_7027919161" class="yiv0011550802yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;" class="yiv0011550802">
                
                <div class="yiv0011550802">
                    On Monday, October 24, 2022 at 08:50:43 a.m. EDT, Bob Nemec <<a rel="nofollow noopener noreferrer" shape="rect" ymailto="mailto:bobn@rogers.com" target="_blank" href="mailto:bobn@rogers.com" class="yiv0011550802">bobn@rogers.com</a>> wrote:
                </div>
                <div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div>
                <div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div>
                <div class="yiv0011550802"><div id="yiv0011550802" class="yiv0011550802"><div class="yiv0011550802"><div style="font-family:lucida console, sans-serif;font-size:13px;" class="yiv0011550802ydp463fbbe9yahoo-style-wrap"><div class="yiv0011550802"></div>
        <div dir="ltr" class="yiv0011550802"><div class="yiv0011550802"><div dir="ltr" class="yiv0011550802">(Also posted on Discord) ... Thanks: we already use the secondary callbacks & passenger patters. In this case, we have a large calendar component for which we're trying to avoid rendering too much cell specific code (html content gets crazy big).</div><div class="yiv0011550802">  </div><div class="yiv0011550802">Ideally, I'd have one script for the calendar that uses JQueryInstance>>closest: to get the div id / passenger, pass that to a script: [...] block, and then have the browser run the script block result. </div><div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div class="yiv0011550802">That works (and we're using it) for static onMouseOver: js script content, but having new content on each mouseover provided by a script: [...] block is where I'm stuck... using the closest: pattern removes the need for cell div specific scripts (with a noticeable render speed  improvement), but I can't pass along the closest div to the script: [...] block to build cell specific content.  </div><div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div class="yiv0011550802">Feels like it a... </div><div class="yiv0011550802">script: [:script :value | ...] value: (js script)</div><div class="yiv0011550802">...pattern should work with a closest: div parameter. Great opportunity for me to learn more Seaside internal :-)  </div></div><br clear="none" class="yiv0011550802"></div><div dir="ltr" class="yiv0011550802">Bob</div>
        
        </div><div id="yiv0011550802yahoo_quoted_7101938615" class="yiv0011550802yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;" class="yiv0011550802">
                
                <div id="yiv0011550802yqt78631" class="yiv0011550802yqt9599951790"><div class="yiv0011550802">
                    On Monday, October 24, 2022 at 03:08:24 a.m. EDT, Johan Brichau <<a rel="nofollow noopener noreferrer" shape="rect" ymailto="mailto:johan@inceptive.be" target="_blank" href="mailto:johan@inceptive.be" class="yiv0011550802">johan@inceptive.be</a>> wrote:
                </div>
                <div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div>
                <div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div>
                <div class="yiv0011550802"><div id="yiv0011550802" class="yiv0011550802"><div class="yiv0011550802">I copy/paste my response on the Discord channel:<div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div class="yiv0011550802"><ol style="margin:0px;padding:0px;border:0px;font-family:Whitney, Helvetica, Arial, sans-serif;font-size:16px;vertical-align:baseline;list-style:none;min-height:0px;orphans:2;widows:2;background-color:rgb(255, 255, 255);" class="yiv0011550802scrollerInner-2PPAp2"><li id="yiv0011550802chat-messages-1033645149160480829" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:none;" class="yiv0011550802messageListItem-ZZ7v6g"><div style="margin:0px 0px;padding-left:72px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;position:relative;padding-right:48px !important;" class="yiv0011550802groupStart-3Mlgv1 yiv0011550802hasReply-2Cr4KE yiv0011550802message-2CShn3 yiv0011550802wrapper-30-Nkg yiv0011550802zalgo-26OfGz yiv0011550802cozyMessage-1DWF9U yiv0011550802cozy-VmLDNB"><div style="margin:0px;padding:0px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;" class="yiv0011550802contents-2MsGLg"><div id="yiv0011550802message-content-1033645149160480829" style="margin:0px 0px 0px;padding:0px 0px 0px 72px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;position:relative;overflow:hidden;" class="yiv0011550802messageContent-2t3eCI yiv0011550802markup-eYLPri">An ajax request with Seaside JQuery can combine multiple secondary callbacks and a single primary callback. You can find out which are which in the method comments on JQAjax. In short: a primary callback is a response-generating callback, while secondary callbacks are callbacks that pass values from the client to the server. 
As such, you can construct what you want already as follows:
<pre style="margin-top:6px;margin-bottom:0px;padding:0px;border:0px;font-style:inherit;font-family:Consolas, Mono Sans Sans Vera Sans Mono Monaco, Courier, monospace;vertical-align:baseline;border-radius:4px;white-space:pre-wrap;max-width:90%;" class="yiv0011550802"><code style="margin:0px;padding:0.5em;border:1px solid;font-style:inherit;font-family:Consolas, Mono Sans Sans Vera Sans Mono Monaco, Courier, monospace;vertical-align:baseline;display:block;border-radius:4px;" class="yiv0011550802hljs yiv0011550802scrollbarGhostHairline-2LpzZ9 yiv0011550802scrollbar-3vVt8d">| value |
html jQuery ajax 
   callback: [ :v | value := v ] value: (html jQuery this propertyAt: 'id');
   script: [ :s | ...use value in the generation of the script... ]</code></pre></div></div><div style="margin:0px;padding:0px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;" class="yiv0011550802buttonContainer-1502pf"><div style="margin:0px;padding:0px 14px 0px 32px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;z-index:1;" class="yiv0011550802container-2gUZhU yiv0011550802buttons-3dF5Kd yiv0011550802isHeader-2bbX-L"><div style="margin:0px;padding:0px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;display:grid;min-height:32px;border-radius:4px;transition:0.1s ease-out 0s, 0.1s ease-out 0s;position:relative;overflow:hidden;" class="yiv0011550802wrapper-2vIMkT"><div style="margin:0px;padding:4px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;display:flex;min-height:24px;min-width:24px;cursor:pointer;position:relative;" class="yiv0011550802button-3bklZh"></div><div style="margin:0px;padding:4px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;display:flex;min-height:24px;min-width:24px;cursor:pointer;position:relative;" class="yiv0011550802button-3bklZh"></div><div style="margin:0px;padding:4px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;display:flex;min-height:24px;min-width:24px;cursor:pointer;position:relative;" class="yiv0011550802button-3bklZh"></div><div style="margin:0px;padding:4px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;display:flex;min-height:24px;min-width:24px;cursor:pointer;position:relative;" class="yiv0011550802button-3bklZh"></div></div></div></div></div></li><li id="yiv0011550802chat-messages-1033646070099623978" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:none;" class="yiv0011550802messageListItem-ZZ7v6g"><div style="margin:0px;padding-left:72px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;position:relative;padding-right:48px !important;" class="yiv0011550802zalgo-26OfGz yiv0011550802cozyMessage-1DWF9U yiv0011550802cozy-VmLDNB yiv0011550802message-2CShn3 yiv0011550802wrapper-30-Nkg"><div style="margin:0px;padding:0px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;" class="yiv0011550802contents-2MsGLg"><span style="margin:0px 0px 0px;padding:0px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;display:inline-block;cursor:default;width:56px;text-align:right;z-index:1;" class="yiv0011550802timestampVisibleOnHover-9PEuZS yiv0011550802timestamp-p1Df1m yiv0011550802latin24CompactTimeStamp-2pXUBq yiv0011550802alt-1dvXnH"><span style="width:0px;display:inline-block;" class="yiv0011550802separator-AebOhG">[</span>9:40 AM<span style="width:0px;display:inline-block;" class="yiv0011550802separator-AebOhG">]</span></span><div id="yiv0011550802message-content-1033646070099623978" style="margin:0px 0px 0px;padding:0px 0px 0px 72px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline;outline:0px;position:relative;overflow:hidden;" class="yiv0011550802messageContent-2t3eCI yiv0011550802markup-eYLPri">Also, take a look at passengers if you want to store objects and retrieve them by id. Seaside has this mechanism built-in for you:
<pre style="margin-top:6px;margin-bottom:0px;padding:0px;border:0px;font-style:inherit;font-family:Consolas, Mono Sans Sans Vera Sans Mono Monaco, Courier, monospace;vertical-align:baseline;border-radius:4px;white-space:pre-wrap;max-width:90%;" class="yiv0011550802"><code style="margin:0px;padding:0.5em;border:1px solid;font-style:inherit;font-family:Consolas, Mono Sans Sans Vera Sans Mono Monaco, Courier, monospace;vertical-align:baseline;display:block;border-radius:4px;" class="yiv0011550802hljs yiv0011550802scrollbarGhostHairline-2LpzZ9 yiv0011550802scrollbar-3vVt8d">| value |
html button
   passenger: self;
   onClick: (html jQuery ajax 
       callback: [ :v | value := v ] passenger: (html jQuery this);</code></pre></div></div></div></li></ol><div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div class="yiv0011550802"><br clear="none" class="yiv0011550802"><blockquote type="cite" class="yiv0011550802"><div id="yiv0011550802yqt33596" class="yiv0011550802yqt7058150919"><div class="yiv0011550802">On 21 Oct 2022, at 19:48, Bob Nemec <<a rel="nofollow noopener noreferrer" shape="rect" ymailto="mailto:bobn@rogers.com" target="_blank" href="mailto:bobn@rogers.com" class="yiv0011550802">bobn@rogers.com</a>> wrote:</div><br clear="none" class="yiv0011550802Apple-interchange-newline"><div class="yiv0011550802"><div class="yiv0011550802"><div style="font-family:lucida console, sans-serif;font-size:13px;" class="yiv0011550802yahoo-style-wrap"><div dir="ltr" class="yiv0011550802">Cross posted from Seaside Discord channel...</div><div dir="ltr" class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div dir="ltr" class="yiv0011550802"><div class="yiv0011550802"><div class="yiv0011550802">I would like to have an 'html ajax script: [...]' method that has a callback:value: pattern. </div><div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div class="yiv0011550802">Something like... </div><div class="yiv0011550802">    html ajax script: [:script :value | ...] value: (html jQuery this propertyAt: 'id') </div><div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div class="yiv0011550802">Then in the script block 'value' would get the id of 'this', which in an ajax callback is undefined. </div><div dir="ltr" class="yiv0011550802">This would allow server code to use browser information to build the script. </div><div class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div class="yiv0011550802">Anyone done this?</div></div><br clear="none" class="yiv0011550802"></div><div dir="ltr" class="yiv0011550802"><br clear="none" class="yiv0011550802"></div><div dir="ltr" class="yiv0011550802">Bob Nemec</div><div dir="ltr" class="yiv0011550802"><br clear="none" class="yiv0011550802"></div></div></div>_______________________________________________<br clear="none" class="yiv0011550802">seaside mailing list<br clear="none" class="yiv0011550802"><a rel="nofollow noopener noreferrer" shape="rect" ymailto="mailto:seaside@lists.squeakfoundation.org" target="_blank" href="mailto:seaside@lists.squeakfoundation.org" class="yiv0011550802">seaside@lists.squeakfoundation.org</a><br clear="none" class="yiv0011550802"><a rel="nofollow noopener noreferrer" shape="rect" target="_blank" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" class="yiv0011550802">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br clear="none" class="yiv0011550802"></div></div></blockquote></div><br clear="none" class="yiv0011550802"></div></div></div><div id="yiv0011550802yqt37085" class="yiv0011550802yqt7058150919">_______________________________________________<br clear="none" class="yiv0011550802">seaside mailing list<br clear="none" class="yiv0011550802"><a rel="nofollow noopener noreferrer" shape="rect" ymailto="mailto:seaside@lists.squeakfoundation.org" target="_blank" href="mailto:seaside@lists.squeakfoundation.org" class="yiv0011550802">seaside@lists.squeakfoundation.org</a><br clear="none" class="yiv0011550802"><a rel="nofollow noopener noreferrer" shape="rect" target="_blank" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" class="yiv0011550802">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br clear="none" class="yiv0011550802"></div></div></div>
            </div>
        </div></div></div><div id="yiv0011550802yqt14635" class="yiv0011550802yqt9599951790">_______________________________________________<br clear="none" class="yiv0011550802">seaside mailing list<br clear="none" class="yiv0011550802"><a rel="nofollow noopener noreferrer" shape="rect" ymailto="mailto:seaside@lists.squeakfoundation.org" target="_blank" href="mailto:seaside@lists.squeakfoundation.org" class="yiv0011550802">seaside@lists.squeakfoundation.org</a><br clear="none" class="yiv0011550802"><a rel="nofollow noopener noreferrer" shape="rect" target="_blank" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" class="yiv0011550802">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br clear="none" class="yiv0011550802"></div></div>
            </div>
        </div></div>_______________________________________________<br clear="none" class="yiv0011550802">seaside mailing list<br clear="none" class="yiv0011550802"><a rel="nofollow noopener noreferrer" shape="rect" ymailto="mailto:seaside@lists.squeakfoundation.org" target="_blank" href="mailto:seaside@lists.squeakfoundation.org" class="yiv0011550802">seaside@lists.squeakfoundation.org</a><br clear="none" class="yiv0011550802">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br clear="none" class="yiv0011550802"></div></div></blockquote></div><br clear="none" class="yiv0011550802"></div></div></div><div class="yqt5406383101" id="yqt96507">_______________________________________________<br clear="none">seaside mailing list<br clear="none"><a shape="rect" ymailto="mailto:seaside@lists.squeakfoundation.org" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br clear="none"><a shape="rect" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br clear="none"></div></div>
            </div>
        </div></body></html>