Hi.<div><br></div><div>I want to, using AJAX, when the user selects a value from a list, pass that value to the server for processing and in response change the value of an item on the screen based on some server-side processing.</div>
<div><br></div><div>I expected to be able to do this in a single transaction with the server, but I have been unable to find a way to do so.</div><div><br></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
anAjax>>#serializeThis allows me to pass the selected value to the server, and anAjax>>#script: allows me to change the screen component value. I can't figure out how to combine this into a single server request. I don't seem to have access to an Ajax canvas object in the callback when I use serializeThis.</div>
<div><br></div><div>I hope I'm missing something simple.</div><div><br></div><div>Here is the toy test case I have been using:</div><div><br></div><div><div>enderContentOn: html</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">        </font></span><font class="Apple-style-span" face="'courier new', monospace">| val |</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">        </font></span><font class="Apple-style-span" face="'courier new', monospace">html div id: 'txt'; with: ''.</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">        </font></span><font class="Apple-style-span" face="'courier new', monospace">html break.</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">        </font></span><font class="Apple-style-span" face="'courier new', monospace">html select</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">list: { 1. 2. 3. };</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">selected: 2;</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">"Pass the selection back to the server and save it."</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">onChange: (html jQuery ajax serializeThis);</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">callback: [ :v | val := v ];</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">"Set the div text to one less than the saved value"</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">onChange: (html jQuery ajax script: [ :s | s << (s jQuery: '#txt') text: (val - 1) ])</font></div>
</div>