I am using the packaged seaside version that comes with VW 7.7. Not updated to latest, because I ran into issues getting the latest out of the cincom public repository. <div>I do have the latest version loaded into pharo and it uses JSJoin for the data option in JQAjax so the java variabels will still be treated as a String.</div>
<div><br></div><div>Using a dictionary for the dataparams is a way to fix this,  but I understand your concerns with multiple keys of the same value. I haven&#39;t figured that one out yet :) maybe using a Dictionary which allows double keys?</div>
<div><div><br></div><div><br><div><div><br><div class="gmail_quote">2010/8/15 Lukas Renggli <span dir="ltr">&lt;<a href="mailto:renggli@gmail.com">renggli@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Are you using all the latest code? There were quite a few changes in<br>
that area recently.<br>
<br>
I doubt that using a dictionary generally works, because the<br>
serialization methods return multiple string parameters.<br>
<br>
Lukas<br>
<br>
On 15 August 2010 18:44, Bart Veenstra &lt;<a href="mailto:bart.veenstra@gmail.com">bart.veenstra@gmail.com</a>&gt; wrote:<br>
&gt; Hello there fellow smalltalkers.<br>
&gt; I am using JQuery alot and some plugins rely on the jquery data to be<br>
&gt; processed as a dictionary instead of a query string generated by JSJoin when<br>
&gt; using a POST request.<br>
&gt; By default  the data object in JQAjax is serialized like this:<br>
&gt;<br>
&gt; bind(&quot;move_node.jstree&quot;, function(e, data) {<br>
&gt;             data.rslt.o.each(function(i) {<br>
&gt;                 $.ajax({<br>
&gt;                     type: &quot;POST&quot;,<br>
&gt;                     data: [&quot;event=move_node.jstree&quot;, &quot;performcopy=&quot; +<br>
&gt; <a href="http://data.rslt.cy" target="_blank">data.rslt.cy</a>, &quot;id=&quot; + $(this).attr(&quot;id&quot;), &quot;metadata=&quot; +<br>
&gt; JSON.stringify($(this).data(&quot;jstree&quot;)), &quot;ref_id=&quot; + data.rslt.np.attr(&quot;id&quot;),<br>
&gt; &quot;ref_metadata=&quot; + JSON.stringify(data.rslt.np.data(&quot;jstree&quot;)), &quot;position=&quot; +<br>
&gt; data.rslt.cp + i, &quot;title=&quot; + <a href="http://data.rslt.name" target="_blank">data.rslt.name</a>, &quot;_s=eOxqO8i-5PB3xS69&quot;,<br>
&gt; &quot;_k=ep5WPiUeiuB5Jw_L&quot;, &quot;5&quot;].join(&quot;&amp;&quot;),<br>
&gt;                     url: &quot;/questionmanager&quot;<br>
&gt;                 })<br>
&gt;             })<br>
&gt;<br>
&gt; Which results in a POST with the following params:<br>
&gt;<br>
&gt; 5_kep5WPiUeiuB5Jw_L_seOxqO8i-5PB3xS69eventmove_node.jstreeidquestioncategory_3metadata{&quot;path&quot;:&quot;sandmin/questioncategories/questioncategory_3&quot;,&quot;id&quot;:3}performcopyundefinedposition50ref_idquestioncategoriesref_metadata{&quot;path&quot;:&quot;sandmin/questioncategories&quot;,&quot;id&quot;:&quot;questioncategories1&quot;}titleundefined<br>

&gt;<br>
&gt; Some values are not correctly translated by javascript because everything is<br>
&gt; presumed a String.<br>
&gt; In this example the concatination of position goes wrong because when<br>
&gt; position=&quot; + data.rslt.cp + i<br>
&gt; is executed, the variabels data.rslt.cp and i are concatinated as a string<br>
&gt; because the whole thing is a string. So the data does not arrive in the way<br>
&gt; I want at the server.<br>
&gt; To fix this issue I made some changes to the data method in JQAjax:<br>
&gt; from:<br>
&gt; JQAjax  data<br>
&gt; ^self options at: &#39;data&#39; ifAbsentPut: [JSJoin new]<br>
&gt; to:<br>
&gt; JQAjax  data<br>
&gt; ^self options at: &#39;data&#39;<br>
&gt; ifAbsentPut:<br>
&gt; [| type |<br>
&gt; type := self options at: &#39;type&#39; ifAbsentPut: [&#39;GET&#39;].<br>
&gt; type = &#39;POST&#39; ifTrue: [GRSmallDictionary new] ifFalse: [JSJoin new]].<br>
&gt; GRSmallDictionary does not understand some methods used by the rest of<br>
&gt; seaside, so I added them as well:<br>
&gt; GRSmallDictionary  add: anAssociation<br>
&gt; anAssociation isVariableBinding<br>
&gt; ifTrue: [self at: anAssociation key put: anAssociation value]<br>
&gt; ifFalse: [self at: anAssociation put: &#39;&#39;].<br>
&gt; ^anAssociation<br>
&gt;<br>
&gt; GRSmallDictionary  addAll: aCollection<br>
&gt; aCollection _addAllToDictionary: self.<br>
&gt; ^aCollection<br>
&gt; GRSmallDictionary  collection<br>
&gt; ^self<br>
&gt;<br>
&gt; This results in the correct serialization of post requests:<br>
&gt; bind(&quot;move_node.jstree&quot;, function(e, data) {<br>
&gt;             data.rslt.o.each(function(i) {<br>
&gt;                 $.ajax({<br>
&gt;                     type: &quot;POST&quot;,<br>
&gt;                     data: {<br>
&gt;                         event: &quot;move_node.jstree&quot;,<br>
&gt;                         performcopy: <a href="http://data.rslt.cy" target="_blank">data.rslt.cy</a>,<br>
&gt;                         id: $(this).attr(&quot;id&quot;),<br>
&gt;                         metadata: JSON.stringify($(this).data(&quot;jstree&quot;)),<br>
&gt;                         &quot;ref_id&quot;: data.rslt.np.attr(&quot;id&quot;),<br>
&gt;                         &quot;ref_metadata&quot;:<br>
&gt; JSON.stringify(data.rslt.np.data(&quot;jstree&quot;)),<br>
&gt;                         position: data.rslt.cp + i,<br>
&gt;                         title: <a href="http://data.rslt.name" target="_blank">data.rslt.name</a>,<br>
&gt;                         &quot;_s&quot;: &quot;Ww1O92fPwzOMnyHw&quot;,<br>
&gt;                         &quot;_k&quot;: &quot;nThH6d1dgDERL5ax&quot;,<br>
&gt;                         &quot;5&quot;: null<br>
&gt;                     },<br>
&gt;                     url: &quot;/questionmanager&quot;<br>
&gt;                 })<br>
&gt;             })<br>
&gt; with the request post parameters:<br>
&gt; 5_kzGF3nB7vsPFGzplS_s2H-w22qrPABNE-Fleventmove_node.jstreeidquestioncategory_4metadata{&quot;path&quot;:&quot;sandmin/questioncategories/questioncategory_4&quot;,&quot;id&quot;:4}position6ref_idquestioncategoriesref_metadata{&quot;path&quot;:&quot;sandmin/questioncategories&quot;,&quot;id&quot;:&quot;questioncategories1&quot;}<br>

&gt; the position is now calculated correctly.<br>
&gt; I don&#39;t know where to go from here :) Atleast it works in my Visual Works<br>
&gt; 7.7 image, But I am unfamiliar with pharo to commit this change.<br>
&gt; Is this something Seaside could use?<br>
&gt; And how can i control the serialization of the dictionary keys. Sometimes<br>
&gt; the are encapsulated by double quotes, and sometimes the aren&#39;t :S.<br>
&gt; Regards,<br>
&gt; Bart Veenstra<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&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>
Lukas Renggli<br>
<a href="http://www.lukas-renggli.ch" target="_blank">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></div>