Passing the parameters through a post request was easier than expected :). <div><div><br></div><div>createBlock: aCreateBlock onSuccess: onSuccessBlock onFail: onFailBlock</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>createBlock := aCreateBlock.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>createSuccessBlock := onSuccessBlock.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>createFailBlock := onFailBlock.</div></div><div>
<div>self</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>call: &#39;bind&#39;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>with: &#39;create.jstree&#39;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>with: ((((JQuery.JQueryClass context: self renderContext) ajax)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>type: &#39;POST&#39;;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>addParameters: ((Grease.GRSmallDictionary new)</div><div>
<span class="Apple-tab-span" style="white-space:pre">                                                        </span>at: &#39;id&#39; put: (JSStream on: &#39;data.rslt.parent.attr(&quot;id&quot;)&#39;);</div><div><span class="Apple-tab-span" style="white-space:pre">                                                        </span>at: &#39;position&#39; put: (JSStream on: &#39;data.rslt.position&#39;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                        </span>at: &#39;title&#39; put: (JSStream on: &#39;<a href="http://data.rslt.name">data.rslt.name</a>&#39;);</div><div><span class="Apple-tab-span" style="white-space:pre">                                                        </span>at: &#39;type&#39; put: (JSStream on: &#39;data.rslt.obj.attr(&quot;rel&quot;)&#39;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                        </span>yourself);</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>callback: </div><div><span class="Apple-tab-span" style="white-space:pre">                                                </span>[| request |</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                </span>request := self requestContext request.</div><div><span class="Apple-tab-span" style="white-space:pre">                                                </span>Transcript</div><div><span class="Apple-tab-span" style="white-space:pre">                                                        </span>cr;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                        </span>show: request fields printString])</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>asFunction: #(#e #data))</div><div><br>
All there is left is to actually do something with the data :) . </div><div><br></div><div>Does anyone have some tips and hints to improve this method? </div><div><br></div><div>Regards,</div><div><br></div><div>Bart</div>
<div><br><div class="gmail_quote">2010/7/25 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;">
Yeah, you are right. Probably the Smalltalk code attaches all data to<br>
the query parameters and not to the post data. I don&#39;t have a computer<br>
to verify, but if so that should be changed.<br>
<font color="#888888"><br>
Lukas<br>
</font><div><div></div><div class="h5"><br>
On Sunday, July 25, 2010, Bart Veenstra &lt;<a href="mailto:bart.veenstra@gmail.com">bart.veenstra@gmail.com</a>&gt; wrote:<br>
&gt; I don&#39;t know. As far as I know, all callback parameters are passed through in a GEt request when using  callback: [:v ] json: javascript stuff.<br>
&gt; I am trying to figure out how to use html jQuery post, but I am not sure on how to combine it with a callback. The only example i could find of post was in a test class which did nothing more than checking the output of the method.<br>

&gt;<br>
&gt; the JQPost method only takes the arguments complete and dataType but in the JQuery documentation i could also specify a data parameters. Should I use jquery ajax with the post method instead of JQPost?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; 2010/7/25 Lukas Renggli &lt;<a href="mailto:renggli@gmail.com">renggli@gmail.com</a>&gt;<br>
&gt; Is there a reason why Seaside doesn&#39;t accept a POST-ed Ajax request?<br>
&gt; At least in Pharo it doesn&#39;t matter if you do your Ajax requests with<br>
&gt; GET (html jQuery get) or POST (html jQuery post).<br>
&gt;<br>
&gt; Lukas<br>
&gt;<br>
&gt; On 25 July 2010 18:39, Bart Veenstra &lt;<a href="mailto:bart.veenstra@gmail.com">bart.veenstra@gmail.com</a>&gt; wrote:<br>
&gt;&gt; Hi,<br>
&gt;&gt; I am using Seaside 3.0 which is included in the VW7.7 image and am trying to<br>
&gt;&gt; create a JQPlugin for jstree (<a href="http://www.jstree.com/demo" target="_blank">http://www.jstree.com/demo</a>).<br>
&gt;&gt; I got the basic functionality working on the tree, but now I would like to<br>
&gt;&gt; have the user create new nodes in the tree using hte context menu.<br>
&gt;&gt; JSTree offers this functionality by binding a function to a create node<br>
&gt;&gt; event.<br>
&gt;&gt; (php example)<br>
&gt;&gt; .bind(&quot;create.jstree&quot;, function (e, data) {<br>
&gt;&gt; $.post(<br>
&gt;&gt; &quot;./server.php&quot;,<br>
&gt;&gt; {<br>
&gt;&gt; &quot;operation&quot; : &quot;create_node&quot;,<br>
&gt;&gt; &quot;id&quot; : data.rslt.parent.attr(&quot;id&quot;).replace(&quot;node_&quot;,&quot;&quot;),<br>
&gt;&gt; &quot;position&quot; : data.rslt.position,<br>
&gt;&gt; &quot;title&quot; : <a href="http://data.rslt.name" target="_blank">data.rslt.name</a>,<br>
&gt;&gt; &quot;type&quot; : data.rslt.obj.attr(&quot;rel&quot;)<br>
&gt;&gt; },<br>
&gt;&gt; function (r) {<br>
&gt;&gt; if(r.status) {<br>
&gt;&gt; $(data.rslt.obj).attr(&quot;id&quot;, &quot;node_&quot; + <a href="http://r.id" target="_blank">r.id</a>);<br>
&gt;&gt; }<br>
&gt;&gt; else {<br>
&gt;&gt; $.jstree.rollback(data.rlbk);<br>
&gt;&gt; }<br>
&gt;&gt; }<br>
&gt;&gt; );<br>
&gt;&gt; })<br>
&gt;&gt; In this javascript example, the parameters are sent to the server using a<br>
&gt;&gt; JQuery Post. The second function takes care of the result and does a<br>
&gt;&gt; rollback if  the creation failed.<br>
&gt;&gt; I want to have the the same functionality in seaside like this:<br>
&gt;&gt; ((html jQuery id: treeId) tree)<br>
&gt;&gt; plugins: #(&#39;json_data&#39; &#39;themes&#39; &#39;ui&#39; &#39;contextmenu&#39; &#39;dnd&#39;);<br>
&gt;&gt; getChildrenBlock: [:node | self getChildren: node];<br>
&gt;&gt; theme: &#39;default&#39;;<br>
&gt;&gt; types: self treeTypes;<br>
&gt;&gt; animation: 0;<br>
&gt;&gt; createBlock: [:node :position :title :type | ] onSuccess: [:node :s |<br>
&gt;&gt; ] onFail: [:ex :s | ]<br>
&gt;&gt; The createBlock first argument holds the seaside translated objects from the<br>
&gt;&gt; javascript call, the second should be executed when the first block executes<br>
&gt;&gt; correctly and the third should be executed when the command failed. The<br>
&gt;&gt; onSuccessBlock should also hold the newly created node and a script to do<br>
&gt;&gt; something wiht the newly created node.<br>
&gt;&gt; What is the best way to accomplish this using a post call instead of a get<br>
&gt;&gt; call? I probably could get this running with a normal GET jquery callback,<br>
&gt;&gt; but I am worried about the length of the get request when using proxies who<br>
&gt;&gt; cut off long urls (this happens quite a lot unfortunatly)<br>
&gt;&gt; I hope anyone could push me in the right direction.<br>
&gt;&gt; Regards,<br>
&gt;&gt;<br>
&gt;&gt; Bart Veenstra<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; seaside mailing list<br>
&gt;&gt; <a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
&gt;&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;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Lukas Renggli<br>
&gt; <a href="http://www.lukas-renggli.ch" target="_blank">www.lukas-renggli.ch</a><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>
&gt;<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">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>
</div></div></blockquote></div><br></div></div>