[Seaside] TwitterBootstrap dropdowns and submitting on change

Mariano Martinez Peck marianopeck at gmail.com
Thu Oct 17 18:40:46 UTC 2013


On Thu, Oct 17, 2013 at 2:37 PM, Paul DeBruicker <pdebruic at gmail.com> wrote:

> Hi Mariano,
>
> I don't understand what you mean when you say "And it doesn't work either"
>
>
The callback is not called.


>
> 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?
>
>
Yes, I do see a GET.


> Maybe you need a
>
> html hiddenInput callback:[self processSubmittedFormData].
>
> at the end of the form.
>
>
mmm I don't get it. Sorry, I am still a bit newbie here.


> What do you want to happen when the link is clicked?
>
>
Quite simple in fact. I just want my callbacks to be invoked. See my
original example:

html form: [
html tbsButtonGroup: [
html tbsDropdownButton beDefault;  beExtraSmall; with: [html text: 'Filter
'; tbsCaret].
html tbsDropdownMenu
with: [
html tbsDropdownMenuItem: [
html anchor
text: 'Selected';
callback: [self halt. ]. ].
html tbsDropdownMenuItem: [
html anchor
text: 'Unselected';
callback: [self halt. ]. ].
]
]

]

you see those halts? I simple want them to really be executed when I click
on an item....

thanks Paul.




>
>
> Thanks
>
> Paul
>
> On Oct 17, 2013, at 10:25 AM, Mariano Martinez Peck <marianopeck at gmail.com>
> wrote:
>
> >
> >
> >
> > On Thu, Oct 17, 2013 at 1:39 PM, Paul DeBruicker <pdebruic at gmail.com>
> wrote:
> > Hi Mariano,
> >
> >
> > Can you use the JQAjax>>serializeForm: ?
> >
> > e.g. for our anchor say:
> >
> > onClick: html jQuery ajax serializeForm:(html jQuery id:'myForm');
> >
> >
> >
> > Hi Paul, I have just tried that doing this:
> >
> > html tbsDropdownMenuItem: [
> >                                       html anchor
> >                                               onClick: (html jQuery ajax
> serializeForm: (html jQuery id: formID));
> >                                               text: 'Selected';
> >                                               callback: [self halt. ]. ].
> >
> >
> > And it doesn't work either. The html for such code is this:
> >
> > <li>
> >
> >     <a
> onclick="jQuery.ajax({"url":"/dp","data":["_s=OpQD8YOfnkSWYrc_","_k=6_McsUmdszVXIFuG","21",jQuery("#id18").closest("form").find(":input").serialize()].join("&")})">
> … </a>
> >
> > </li>
> >
> > and indeed, "#id18" is the correct id of the form.
> >
> > Ant other idea?
> >
> > Thanks in advance,
> >
> >
> >
> >
> >
> >
> >
> > On Oct 17, 2013, at 7:48 AM, Mariano Martinez Peck <
> marianopeck at gmail.com> wrote:
> >
> > > Hi guys,
> > >
> > > 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....).
> > >
> > > 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
> > >
> > > onClick: 'submit()';
> > >
> > > to the tbsDropdownMenu. The form seems to be submitted, but the
> callbacks of my anchors never get called:
> > >
> > > Reduced example:
> > >
> > > html form: [
> > > html tbsButtonGroup: [
> > >               html tbsDropdownButton beDefault;  beExtraSmall; with:
> [html text: 'Filter '; tbsCaret].
> > >               html tbsDropdownMenu
> > >                       onClick: 'submit()';
> > >                       with: [
> > >                               html tbsDropdownMenuItem: [
> > >                                       html anchor
> > >                                               text: 'Selected';
> > >                                               callback: [self halt. ].
> ].
> > >                               html tbsDropdownMenuItem: [
> > >                                       html anchor
> > >                                               text: 'Unselected';
> > >                                               callback: [self halt. ].
> ].
> > >                       ]
> > >       ]
> > >
> > > ]
> > >
> > > Any ideas?
> > >
> > > Thanks
> > >
> > > --
> > > Mariano
> > > http://marianopeck.wordpress.com
> > > _______________________________________________
> > > seaside mailing list
> > > seaside at lists.squeakfoundation.org
> > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> >
> >
> > --
> > Mariano
> > http://marianopeck.wordpress.com
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20131017/15de69d8/attachment.htm


More information about the seaside mailing list