<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'>
I think more fundamentally speaking, you're not actually wanting to modify the callback, you're trying to modify the list, right? The callback doesn't care what it's sending (or shouldn't).<div><br></div><div>If you're trying to update the select element options from server data, you can easily handle that in the ajax success callback. If you're changing the options based on some client-side JavaScript, you could insert that function or use Seaside's JavaScript utilities to accomplish the same thing.</div><div><br></div><div>ie. (using jQuery)</div><div>var figureOutNewListOptions = function() {</div><div>&nbsp; &nbsp; // some function</div><div>&nbsp; &nbsp; // OR</div><div>&nbsp; &nbsp; $.get('http://www.mydata.com/getdata', function( data ) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; // clear current options</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="font-size: 10pt; ">$('selectField').html('');</span></div><div>&nbsp; &nbsp; &nbsp; &nbsp; ( var i = 0; i &lt; data.records.length; i++ ) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $('selectField').append('&lt;option name='+data.records[i]+'value='+data.records[i]+'&gt;'+<span style="font-size: 10pt; ">data.records[i]</span><span style="font-size: 10pt; ">+'&lt;/option&gt;');</span></div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; });</div><div>}</div><div>var updateList = function() {</div><div>&nbsp; &nbsp; var userInput = $('#userInputTextField').val();</div><div>&nbsp; &nbsp; // validate</div><div>&nbsp; &nbsp; figureOutNewListOptions();</div><div>}</div><div><br></div><div>Wow, that's a painful example but I hope it helps. Sorry for not writing it in Smalltalk lol.</div><div>Hope that helps... I haven't had a change to touch Seaside lately :( JavaScript has taken over my life. Suck.</div><div><br></div><div>RS</div><div><br><div><div id="SkyDrivePlaceholder"></div>&gt; To: seaside@lists.squeakfoundation.org<br>&gt; From: squeakman@gmail.com<br>&gt; Date: Sun, 19 Aug 2012 12:53:16 -0400<br>&gt; Subject: [Seaside] Re: How to change callback for html select on the fly<br>&gt; <br>&gt; On 19/08/2012 10:24 AM, Bob Arning wrote:<br>&gt; &gt; Why not just make the original callback sufficiently generic that it can<br>&gt; &gt; cope with the change?<br>&gt; &gt;<br>&gt; &gt; html text: 'Choose Amount'.<br>&gt; &gt;          (html select)<br>&gt; &gt;          id: #prices;<br>&gt; &gt;          callback: [:v | self doWhateverIsImportantNowWith: v];<br>&gt; &gt;          list: #(30 50 60).<br>&gt; &gt;<br>&gt; &gt; Cheers,<br>&gt; &gt; Bob<br>&gt; &gt;<br>&gt; <br>&gt; The problem with this proposed solution is that the list of choices #(30 <br>&gt; 50 60) does not change on the fly.  What I want is to change the list of <br>&gt; choices, the dropdown list, on the fly.<br>&gt; <br>&gt; When the user exits the text field, depending on the contents of the <br>&gt; text field, the choices are modified.  In my code example, it switches <br>&gt; from #(30 50 60) to #(15 25).<br>&gt; <br>&gt; I hope this further clarifies what I am trying to do.<br>&gt; <br>&gt; I appreciate your feedback.<br>&gt; <br>&gt; Thanks,<br>&gt; <br>&gt; Frank<br>&gt; <br>&gt; <br>&gt; _______________________________________________<br>&gt; seaside mailing list<br>&gt; seaside@lists.squeakfoundation.org<br>&gt; http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br></div></div>                                               </div></body>
</html>