<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 17, 2013 at 6:23 PM, Paul DeBruicker <span dir="ltr">&lt;<a href="mailto:pdebruic@gmail.com" target="_blank" class="vt-p">pdebruic@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
I think you&#39;re trying to find out about something by asking about something else, and in this instance its confusing.  What I suspect you are trying to do is:<br>
<br>
1. user clicks dropdown menu item<br>
2. form data is submitted to server<br>
3. form callback is processed based on which menu item is clicked<br>
4. UI is updated based on calculations and data<br>
<br></blockquote><div><br></div><div>Ouch Paul.....you will kill me....I have wasted your time.. Sorry. I found out my stupid problem.</div><div>I added the form just as an immediate &quot;give it a try&quot; because my callbacks were not being executed. But no, I didn&#39;t have any data in there. </div>
<div>Now, why my callbacks were no being called? because of the most stupid error. At least nobody saw it in the pasted code either hahaha.</div><div>I was defining the anchors as:</div><div><br></div><div>html anchor text: &#39;something&#39;; callback: [ self halt  ].<br>
</div><div><br></div><div>just changing it to</div><div><br></div><div>html anchor  callback: [ self halt  ]; with: &#39;something&#39;;<br></div><div><br></div><div>make the callbacks work...</div><div><br></div><div>Again, sorry to waste your time and thanks for your help!</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
more below:<br>
<div class="im"><br>
On Oct 17, 2013, at 11:40 AM, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com" class="vt-p">marianopeck@gmail.com</a>&gt; wrote:<br>
<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Oct 17, 2013 at 2:37 PM, Paul DeBruicker &lt;<a href="mailto:pdebruic@gmail.com" class="vt-p">pdebruic@gmail.com</a>&gt; wrote:<br>
&gt; Hi Mariano,<br>
&gt;<br>
&gt; I don&#39;t understand what you mean when you say &quot;And it doesn&#39;t work either&quot;<br>
&gt;<br>
&gt;<br>
&gt; The callback is not called.<br>
<br>
</div>You can&#39;t have the anchor callbacks processed as part of the form submission process because anchors aren&#39;t form elements, but navigation elements.  They can trigger a form submission using javascript and thats about it when it comes to forms &amp; anchors.<br>

<br>
You can either attach those callbacks to #hiddenInputs next to each anchor or just use one hiddenInput at the bottom of the form (which is what I recommend if you want the same thing to happen no matter what link is clicked)<br>

<br>
If you want a different callback to be processed based on which anchor is clicked and have the UI updated then do this:<br>
<div class="im"><br>
<br>
html anchor<br>
                onClick:<br>
                        (html jQuery ajax<br>
</div>                                serializeForm: (html jQuery id: &#39;myForm&#39;);<br>
                                onSuccess:<br>
                                                ((html jQuery id: &#39;myForm&#39;) load<br>
                                                                html: [ :h |<br>
                                                                        self selectedCallback.<br>
                                                                        self renderForm: h ])).<br>
                with: &#39;Selected&#39;.<br>
<br>
Which serializes the form data, then replaces the form after performing the #selectedCallback<br>
<div class="im"><br>
<br>
&gt;<br>
&gt;<br>
&gt; That should serialize the form and the data in the inputs to the server.  In the javascript debugger do you see a &#39;GET&#39; after clicking the link that has the form data?<br>
&gt;<br>
&gt;<br>
&gt; Yes, I do see a GET.<br>
&gt;<br>
&gt; Maybe you need a<br>
&gt;<br>
&gt; html hiddenInput callback:[self processSubmittedFormData].<br>
&gt;<br>
&gt; at the end of the form.<br>
&gt;<br>
&gt;<br>
&gt; mmm I don&#39;t get it. Sorry, I am still a bit newbie here.<br>
&gt;<br>
<br>
<br>
</div>So if all of the callbacks in your example do the same thing then take the callbacks off the anchors and at the end of the form insert a #hiddenInput.  Attach a callback to that #hiddenInput which will process all the data.  Put it at the end of the form so all of the form&#39;s data will have been processed by seaside by the time its time to run the #hiddenInput&#39;s callback.<br>

<div class="im"><br>
<br>
&gt; What do you want to happen when the link is clicked?<br>
&gt;<br>
&gt;<br>
&gt; Quite simple in fact. I just want my callbacks to be invoked. See my original example:<br>
&gt;<br>
<br>
</div>I think the #hiddenIpnut or the JQuery monstrosity above should cover it but do you mean all of them anytime one a link is clicked or just the one nearest the link?<br>
<div class=""><div class="h5"><br>
<br>
&gt; html form: [<br>
&gt; html tbsButtonGroup: [<br>
&gt;               html tbsDropdownButton beDefault;  beExtraSmall; with: [html text: &#39;Filter &#39;; tbsCaret].<br>
&gt;               html tbsDropdownMenu<br>
&gt;                       with: [<br>
&gt;                               html tbsDropdownMenuItem: [<br>
&gt;                                       html anchor<br>
&gt;                                               text: &#39;Selected&#39;;<br>
&gt;                                               callback: [self halt. ]. ].<br>
&gt;                               html tbsDropdownMenuItem: [<br>
&gt;                                       html anchor<br>
&gt;                                               text: &#39;Unselected&#39;;<br>
&gt;                                               callback: [self halt. ]. ].<br>
&gt;                       ]<br>
&gt;       ]<br>
&gt;<br>
&gt; ]<br>
&gt;<br>
&gt; you see those halts? I simple want them to really be executed when I click on an item....<br>
&gt;<br>
&gt; thanks Paul.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Thanks<br>
&gt;<br>
&gt; Paul<br>
&gt;<br>
&gt; On Oct 17, 2013, at 10:25 AM, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com" class="vt-p">marianopeck@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; On Thu, Oct 17, 2013 at 1:39 PM, Paul DeBruicker &lt;<a href="mailto:pdebruic@gmail.com" class="vt-p">pdebruic@gmail.com</a>&gt; wrote:<br>
&gt; &gt; Hi Mariano,<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Can you use the JQAjax&gt;&gt;serializeForm: ?<br>
&gt; &gt;<br>
&gt; &gt; e.g. for our anchor say:<br>
&gt; &gt;<br>
&gt; &gt; onClick: html jQuery ajax serializeForm:(html jQuery id:&#39;myForm&#39;);<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Hi Paul, I have just tried that doing this:<br>
&gt; &gt;<br>
&gt; &gt; html tbsDropdownMenuItem: [<br>
&gt; &gt;                                       html anchor<br>
&gt; &gt;                                               onClick: (html jQuery ajax serializeForm: (html jQuery id: formID));<br>
&gt; &gt;                                               text: &#39;Selected&#39;;<br>
&gt; &gt;                                               callback: [self halt. ]. ].<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; And it doesn&#39;t work either. The html for such code is this:<br>
&gt; &gt;<br>
&gt; &gt; &lt;li&gt;<br>
&gt; &gt;<br>
&gt; &gt;     &lt;a onclick=&quot;jQuery.ajax({&quot;url&quot;:&quot;/dp&quot;,&quot;data&quot;:[&quot;_s=OpQD8YOfnkSWYrc_&quot;,&quot;_k=6_McsUmdszVXIFuG&quot;,&quot;21&quot;,jQuery(&quot;#id18&quot;).closest(&quot;form&quot;).find(&quot;:input&quot;).serialize()].join(&quot;&amp;&quot;)})&quot;&gt; … &lt;/a&gt;<br>

&gt; &gt;<br>
&gt; &gt; &lt;/li&gt;<br>
&gt; &gt;<br>
&gt; &gt; and indeed, &quot;#id18&quot; is the correct id of the form.<br>
&gt; &gt;<br>
&gt; &gt; Ant other idea?<br>
&gt; &gt;<br>
&gt; &gt; Thanks in advance,<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; On Oct 17, 2013, at 7:48 AM, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com" class="vt-p">marianopeck@gmail.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; &gt; Hi guys,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; In my application I have many many places in which I need to submit the surrounding form once an item has been selected from a list or things like that. For example, for a &quot;html select&quot;, I am relying on #beSubmitOnChange (which is deprecated....).<br>

&gt; &gt; &gt;<br>
&gt; &gt; &gt; I am now using #tbsButtonGroup and #tbsDropdownMenu (they are inside a form with another html selects) and I want to achieve the same. I added a<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; onClick: &#39;submit()&#39;;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; to the tbsDropdownMenu. The form seems to be submitted, but the callbacks of my anchors never get called:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Reduced example:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; html form: [<br>
&gt; &gt; &gt; html tbsButtonGroup: [<br>
&gt; &gt; &gt;               html tbsDropdownButton beDefault;  beExtraSmall; with: [html text: &#39;Filter &#39;; tbsCaret].<br>
&gt; &gt; &gt;               html tbsDropdownMenu<br>
&gt; &gt; &gt;                       onClick: &#39;submit()&#39;;<br>
&gt; &gt; &gt;                       with: [<br>
&gt; &gt; &gt;                               html tbsDropdownMenuItem: [<br>
&gt; &gt; &gt;                                       html anchor<br>
&gt; &gt; &gt;                                               text: &#39;Selected&#39;;<br>
&gt; &gt; &gt;                                               callback: [self halt. ]. ].<br>
&gt; &gt; &gt;                               html tbsDropdownMenuItem: [<br>
&gt; &gt; &gt;                                       html anchor<br>
&gt; &gt; &gt;                                               text: &#39;Unselected&#39;;<br>
&gt; &gt; &gt;                                               callback: [self halt. ]. ].<br>
&gt; &gt; &gt;                       ]<br>
&gt; &gt; &gt;       ]<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; ]<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Any ideas?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Thanks<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; --<br>
&gt; &gt; &gt; Mariano<br>
&gt; &gt; &gt; <a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; seaside mailing list<br>
&gt; &gt; &gt; <a href="mailto:seaside@lists.squeakfoundation.org" class="vt-p">seaside@lists.squeakfoundation.org</a><br>
&gt; &gt; &gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="vt-p">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; seaside mailing list<br>
&gt; &gt; <a href="mailto:seaside@lists.squeakfoundation.org" class="vt-p">seaside@lists.squeakfoundation.org</a><br>
&gt; &gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="vt-p">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Mariano<br>
&gt; &gt; <a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; seaside mailing list<br>
&gt; &gt; <a href="mailto:seaside@lists.squeakfoundation.org" class="vt-p">seaside@lists.squeakfoundation.org</a><br>
&gt; &gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="vt-p">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; seaside mailing list<br>
&gt; <a href="mailto:seaside@lists.squeakfoundation.org" class="vt-p">seaside@lists.squeakfoundation.org</a><br>
&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="vt-p">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Mariano<br>
&gt; <a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><br>
&gt; _______________________________________________<br>
&gt; seaside mailing list<br>
&gt; <a href="mailto:seaside@lists.squeakfoundation.org" class="vt-p">seaside@lists.squeakfoundation.org</a><br>
&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="vt-p">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" class="vt-p">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="vt-p">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><br>
</div></div>