<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"><<a href="mailto:pdebruic@gmail.com" target="_blank" class="vt-p">pdebruic@gmail.com</a>></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'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 "give it a try" because my callbacks were not being executed. But no, I didn'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: 'something'; callback: [ self halt ].<br>
</div><div><br></div><div>just changing it to</div><div><br></div><div>html anchor callback: [ self halt ]; with: 'something';<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 <<a href="mailto:marianopeck@gmail.com" class="vt-p">marianopeck@gmail.com</a>> wrote:<br>
<br>
><br>
><br>
><br>
> On Thu, Oct 17, 2013 at 2:37 PM, Paul DeBruicker <<a href="mailto:pdebruic@gmail.com" class="vt-p">pdebruic@gmail.com</a>> wrote:<br>
> Hi Mariano,<br>
><br>
> I don't understand what you mean when you say "And it doesn't work either"<br>
><br>
><br>
> The callback is not called.<br>
<br>
</div>You can't have the anchor callbacks processed as part of the form submission process because anchors aren't form elements, but navigation elements. They can trigger a form submission using javascript and thats about it when it comes to forms & 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: 'myForm');<br>
onSuccess:<br>
((html jQuery id: 'myForm') load<br>
html: [ :h |<br>
self selectedCallback.<br>
self renderForm: h ])).<br>
with: 'Selected'.<br>
<br>
Which serializes the form data, then replaces the form after performing the #selectedCallback<br>
<div class="im"><br>
<br>
><br>
><br>
> That should serialize the form and the data in the inputs to the server. In the javascript debugger do you see a 'GET' after clicking the link that has the form data?<br>
><br>
><br>
> Yes, I do see a GET.<br>
><br>
> Maybe you need a<br>
><br>
> html hiddenInput callback:[self processSubmittedFormData].<br>
><br>
> at the end of the form.<br>
><br>
><br>
> mmm I don't get it. Sorry, I am still a bit newbie here.<br>
><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's data will have been processed by seaside by the time its time to run the #hiddenInput's callback.<br>
<div class="im"><br>
<br>
> What do you want to happen when the link is clicked?<br>
><br>
><br>
> Quite simple in fact. I just want my callbacks to be invoked. See my original example:<br>
><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>
> html form: [<br>
> html tbsButtonGroup: [<br>
> html tbsDropdownButton beDefault; beExtraSmall; with: [html text: 'Filter '; tbsCaret].<br>
> html tbsDropdownMenu<br>
> with: [<br>
> html tbsDropdownMenuItem: [<br>
> html anchor<br>
> text: 'Selected';<br>
> callback: [self halt. ]. ].<br>
> html tbsDropdownMenuItem: [<br>
> html anchor<br>
> text: 'Unselected';<br>
> callback: [self halt. ]. ].<br>
> ]<br>
> ]<br>
><br>
> ]<br>
><br>
> you see those halts? I simple want them to really be executed when I click on an item....<br>
><br>
> thanks Paul.<br>
><br>
><br>
><br>
><br>
><br>
> Thanks<br>
><br>
> Paul<br>
><br>
> On Oct 17, 2013, at 10:25 AM, Mariano Martinez Peck <<a href="mailto:marianopeck@gmail.com" class="vt-p">marianopeck@gmail.com</a>> wrote:<br>
><br>
> ><br>
> ><br>
> ><br>
> > On Thu, Oct 17, 2013 at 1:39 PM, Paul DeBruicker <<a href="mailto:pdebruic@gmail.com" class="vt-p">pdebruic@gmail.com</a>> wrote:<br>
> > Hi Mariano,<br>
> ><br>
> ><br>
> > Can you use the JQAjax>>serializeForm: ?<br>
> ><br>
> > e.g. for our anchor say:<br>
> ><br>
> > onClick: html jQuery ajax serializeForm:(html jQuery id:'myForm');<br>
> ><br>
> ><br>
> ><br>
> > Hi Paul, I have just tried that doing this:<br>
> ><br>
> > html tbsDropdownMenuItem: [<br>
> > html anchor<br>
> > onClick: (html jQuery ajax serializeForm: (html jQuery id: formID));<br>
> > text: 'Selected';<br>
> > callback: [self halt. ]. ].<br>
> ><br>
> ><br>
> > And it doesn't work either. The html for such code is this:<br>
> ><br>
> > <li><br>
> ><br>
> > <a onclick="jQuery.ajax({"url":"/dp","data":["_s=OpQD8YOfnkSWYrc_","_k=6_McsUmdszVXIFuG","21",jQuery("#id18").closest("form").find(":input").serialize()].join("&")})"> … </a><br>
> ><br>
> > </li><br>
> ><br>
> > and indeed, "#id18" is the correct id of the form.<br>
> ><br>
> > Ant other idea?<br>
> ><br>
> > Thanks in advance,<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > On Oct 17, 2013, at 7:48 AM, Mariano Martinez Peck <<a href="mailto:marianopeck@gmail.com" class="vt-p">marianopeck@gmail.com</a>> wrote:<br>
> ><br>
> > > Hi guys,<br>
> > ><br>
> > > 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 "html select", I am relying on #beSubmitOnChange (which is deprecated....).<br>
> > ><br>
> > > 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>
> > ><br>
> > > onClick: 'submit()';<br>
> > ><br>
> > > to the tbsDropdownMenu. The form seems to be submitted, but the callbacks of my anchors never get called:<br>
> > ><br>
> > > Reduced example:<br>
> > ><br>
> > > html form: [<br>
> > > html tbsButtonGroup: [<br>
> > > html tbsDropdownButton beDefault; beExtraSmall; with: [html text: 'Filter '; tbsCaret].<br>
> > > html tbsDropdownMenu<br>
> > > onClick: 'submit()';<br>
> > > with: [<br>
> > > html tbsDropdownMenuItem: [<br>
> > > html anchor<br>
> > > text: 'Selected';<br>
> > > callback: [self halt. ]. ].<br>
> > > html tbsDropdownMenuItem: [<br>
> > > html anchor<br>
> > > text: 'Unselected';<br>
> > > callback: [self halt. ]. ].<br>
> > > ]<br>
> > > ]<br>
> > ><br>
> > > ]<br>
> > ><br>
> > > Any ideas?<br>
> > ><br>
> > > Thanks<br>
> > ><br>
> > > --<br>
> > > Mariano<br>
> > > <a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><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>
> ><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>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Mariano<br>
> > <a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><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>
><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>
><br>
><br>
><br>
> --<br>
> Mariano<br>
> <a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><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>
<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>