Cool, thank you for the explanation! :)<div>That helped a lot, especially the last part about using #script: and about using #closest: . I couldn&#39;t figure it out for myself since I&#39;m sometimes too insecure what methods to use when and what their semantic is, sigh.<div>
<div><br></div><div>Is something like the following actually possible at all?</div><div><br></div><div>html div onClick: (html jQuery this attributeAt: &#39;title&#39; put: (html jQuery ajax loadValue: [ :s | s nextPutAll: #{test -&gt; 1}]))</div>
<div><br></div><div>I&#39;ve seen JQAjax&gt;&gt;#callback:json: but I can&#39;t wrap my head around how this works.<br>&gt;&lt;</div><div><br></div><div><br><div class="gmail_quote">On Tue, Oct 6, 2009 at 2:31 PM, Lukas Renggli <span dir="ltr">&lt;<a href="mailto:renggli@gmail.com">renggli@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">2009/10/6 Richard Durr &lt;<a href="mailto:richard.durr@googlemail.com">richard.durr@googlemail.com</a>&gt;:<br>
<div class="im">&gt; Hello,<br>
&gt; I&#39;d like to set the background-color of a parent element that contains a<br>
&gt; selectbox using ajax without replacing the whole. I tried to load the value<br>
&gt; through &quot;ajax html:&quot; like so:<br>
&gt; html select<br>
&gt;   onChange: (html jQuery ajax serialize: html jQuery this) ,<br>
&gt;     ((html jQuery this parent: &#39;.model&#39; ) cssAt: &#39;background-color&#39; put:<br>
&gt; (html jQuery ajax html: [:r | r text: &#39;red&#39; ]));<br>
&gt;   callback: [ :value | aModelObject color: value key. ];<br>
&gt;   selected: selectedColor;<br>
&gt;   addAll: colors;<br>
&gt;   labels: [:item | item value.].<br>
<br>
</div>The use of<br>
<div class="im"><br>
   html jQuery this parent: &#39;.model&#39;<br>
<br>
</div>is a bit strange, because this only returns the *direct* parents that<br>
have the class .model. You might easily end up with an empty result<br>
set and simply nothing happens. It might not be a problem in your<br>
case, but it would be more intention revealing if you used #closest:<br>
instead of #parent:<br>
<br>
The expression<br>
<div class="im"><br>
   html jQuery ajax html: [:r | r text: &#39;red&#39; ]<br>
<br>
</div>does not return the requested value, but the AJAX object itself.<br>
Furthermore AJAX calls are asynchronous, so they immediately return.<br>
<br>
Something along the following lines should work:<br>
<br>
   (html jQuery this closest: &#39;.model&#39;) cssAt: &#39;background-color&#39; put: &#39;red&#39;<br>
<br>
If you want to go through a server round-trip you could integrate the<br>
change into the AJAX call you do to serialize the value. What about<br>
something along ...<br>
<br>
   html jQuery ajax<br>
        serialize: html jQuery this;<br>
        script: [ :script | script add: ((script jQuery: &#39;.model&#39;)<br>
cssAt: &#39;background-color&#39; put: currentColor) ]<br>
<br>
Cheers,<br>
Lukas<br>
<font color="#888888"><br>
--<br>
Lukas Renggli<br>
<a href="http://www.lukas-renggli.ch" target="_blank">http://www.lukas-renggli.ch</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><br></div></div></div>