<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
The callback won't be executed until the select element is serialized (either via ajax or submission), so in order to get the currently selected value, you will need to serialize first.<div><br>RS<br><br><div><hr id="stopSpelling">Date: Tue, 13 Sep 2011 14:32:02 +0100<br>Subject: Re: [Seaside] capture client events in seaside?<br>From: nick.ager@gmail.com<br>To: seaside@lists.squeakfoundation.org<br><br><div><div class="ecxim"><div>| selectId |</div><div><br></div><div>You could try something like (untested):</div><div><br></div><div>html select&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; id: (selectId := html nextId);</div><div><span style="white-space:pre-wrap">        </span>list: Dao new allProducts;</div>
</div><div><span style="white-space:pre-wrap">        </span>selected: currentProduct;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <i>callback: [ :value | currentProduct := value ];</i></div><div class="ecxim"><div>&nbsp;<span style="white-space:pre-wrap">        </span>onChange:&nbsp;(html jQuery ajax script: [ :s |&nbsp;</div>
</div></div><div><span class="ecxApple-tab-span" style="white-space:pre">                </span>s &lt;&lt; "render updates here"]; serialize: (html jQuery id: selectId))</div><div><br></div><br><div class="ecxgmail_quote">On 13 September 2011 14:18, Larry White <span dir="ltr">&lt;<a href="mailto:ljw1001@gmail.com">ljw1001@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex">hmm. I tried your suggestion and it's almost working, but I don't see how to get the current selection value back. &nbsp;If I replace the [do your stuff here] block with one that accepts an argument, like [:val | doSomethingWIth: val] I get an exception stating that the block wants an argument, but it's not being called with one.&nbsp;<div>

<br></div><div>I tried to use<i> html select callback: </i>to get the selected value (this seems to be what the example on the Jquery/seaside web pages show), but it never gets invoked:<br><div><br></div><div><div class="ecxim">
<div><span style="white-space:pre-wrap">        </span>html select&nbsp;</div>
<div><span style="white-space:pre-wrap">                        </span>list: Dao new allProducts;</div></div><div><span style="white-space:pre-wrap">                        </span>selected: currentProduct;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="white-space:pre-wrap">                </span><i>callback: [ :value | currentProduct := value ];</i></div>
<div class="ecxim">
<div>&nbsp;<span style="white-space:pre-wrap">                        </span>onChange: (html jQuery ajax callback: [&nbsp;</div></div><div><span style="white-space:pre-wrap">                                        </span>productEntryAction value: currentProduct]).</div>
<div><br></div><div>Any other suggestions would be appreciated. Thanks again.</div><div><br></div><div><br><div><div><div class="ecxgmail_quote"><div class="ecxim">On Sun, Sep 11, 2011 at 2:46 PM, Milan Mimica <span dir="ltr">&lt;<a href="mailto:milan.mimica@gmail.com">milan.mimica@gmail.com</a>&gt;</span> wrote:<br>

</div><div><div></div><div class="h5"><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex">html select list<br>
 &nbsp;onChange: (html jQuery ajax callback: [ do your stuff here ]).<br>
<div><div></div><div><br>
<br>
On 11 September 2011 20:39, Larry White &lt;<a href="mailto:ljw1001@gmail.com">ljw1001@gmail.com</a>&gt; wrote:<br>
&gt; Hi what is the best way to capture a client-side event in seaside?<br>
&gt; I have a menu that includes a select box. I would like to capture the select<br>
&gt; event so that I can update a view when the selection changes.<br>
&gt; html select &nbsp;list: (Dao new) allProducts;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; callback: [ :value |<br>
&gt; productEntryAction value].<br>
&gt; I guess I could wrap it in a form and put a 'go' submitButton next to it,<br>
&gt; but that seems so 2004 ;) &nbsp;Is there anything better?<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; seaside mailing list<br>
&gt; <a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
&gt;<br>
&gt;<br>
<font color="#888888"><br>
<br>
<br>
--<br>
Milan Mimica<br>
<a href="http://sparklet.sf.net" target="_blank">http://sparklet.sf.net</a><br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</font></blockquote></div></div></div><br></div></div></div></div></div>
<br>_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div><br>
<br>_______________________________________________
seaside mailing list
seaside@lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</div></div>                                               </div></body>
</html>