cancelButton using WAButtonTag

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

cancelButton using WAButtonTag

keropotter
Hi!! I'm developping an application using JQuery decorations, where the buttons have icons.

I have one button inside a form that's suposed to execute a Task, but I wish NOT to submit the form by pressing that button given that I do a series of validations on every input callback. So if the form submits, it fails because of the validations. I've tried using a #cancelButton but unfortunately it generates a <input type="button" ...> which doesn't support JQuery's .button icon styling (which I need in order to keep the layout of the page)

Is there any way to achieve the same behaviour of cancelButton by using an ordinary button?

I've tried using a #button bePush; and invoking a callback via ajax, but that ajax callback doesn't execute the button's callback, where I'm making a #call: to a WATask. Here's a piece of code for that purpose:

        aCanvas button
                bePush;
                callback: [ self call: MyTask new ];
                script: (aCanvas jQuery this button primaryIcon: 'ui-icon-plus');
                onClick: "I think here I should execute the button's callback"
                with: 'Execute Task'.

Any ideas on how to do this?

Many thanks in advance!!
Alejandro
Reply | Threaded
Open this post in threaded view
|

Re: cancelButton using WAButtonTag

John McKeon
Try onClick: (aCanvas jQuery ajax serializeThis);

On Thu, Oct 20, 2011 at 3:12 PM, keropotter <[hidden email]> wrote:
Hi!! I'm developping an application using JQuery decorations, where the
buttons have icons.

I have one button inside a form that's suposed to execute a Task, but I wish
NOT to submit the form by pressing that button given that I do a series of
validations on every input callback. So if the form submits, it fails
because of the validations. I've tried using a #cancelButton but
unfortunately it generates a <input type="button" ...> which doesn't support
JQuery's .button icon styling (which I need in order to keep the layout of
the page)

Is there any way to achieve the same behaviour of cancelButton by using an
ordinary button?

I've tried using a #button bePush; and invoking a callback via ajax, but
that ajax callback doesn't execute the button's callback, where I'm making a
#call: to a WATask. Here's a piece of code for that purpose:

       aCanvas button
               bePush;
               callback: [ self call: MyTask new ];
               script: (aCanvas jQuery this button primaryIcon: 'ui-icon-plus');
               onClick: "I think here I should execute the button's callback"
               with: 'Execute Task'.

Any ideas on how to do this?

Many thanks in advance!!
Alejandro

--
View this message in context: http://forum.world.st/cancelButton-using-WAButtonTag-tp3923147p3923147.html
Sent from the Seaside General mailing list archive at Nabble.com.
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: cancelButton using WAButtonTag

keropotter
Hi, John! Thanks for your quick reply!

Unfortunatelly it doesn't work. Here is my code:

aCanvas button
  bePush;
  callback: self callback;
  script: (aCanvas jQuery this button primaryIcon: 'ui-icon-plus');
  onClick: (aCanvas jQuery ajax serializeThis);
  with: self label.

Is there any other way to disable callbacks execution when a form submits? I've also tried emulating cancelButtons behaviour by wrapping my own callback with WACancelActionCallback it complains about needing a NiladicValuable block.

Thanks again!

On Thu, Oct 20, 2011 at 6:08 PM, John McKeon <[hidden email]> wrote:
Try onClick: (aCanvas jQuery ajax serializeThis);


On Thu, Oct 20, 2011 at 3:12 PM, keropotter <[hidden email]> wrote:
Hi!! I'm developping an application using JQuery decorations, where the
buttons have icons.

I have one button inside a form that's suposed to execute a Task, but I wish
NOT to submit the form by pressing that button given that I do a series of
validations on every input callback. So if the form submits, it fails
because of the validations. I've tried using a #cancelButton but
unfortunately it generates a <input type="button" ...> which doesn't support
JQuery's .button icon styling (which I need in order to keep the layout of
the page)

Is there any way to achieve the same behaviour of cancelButton by using an
ordinary button?

I've tried using a #button bePush; and invoking a callback via ajax, but
that ajax callback doesn't execute the button's callback, where I'm making a
#call: to a WATask. Here's a piece of code for that purpose:

       aCanvas button
               bePush;
               callback: [ self call: MyTask new ];
               script: (aCanvas jQuery this button primaryIcon: 'ui-icon-plus');
               onClick: "I think here I should execute the button's callback"
               with: 'Execute Task'.

Any ideas on how to do this?

Many thanks in advance!!
Alejandro

--
View this message in context: http://forum.world.st/cancelButton-using-WAButtonTag-tp3923147p3923147.html
Sent from the Seaside General mailing list archive at Nabble.com.
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: cancelButton using WAButtonTag

Robert Sirois
You can just put the ajax callback in the click handler.

RS


From: [hidden email]
Date: Fri, 21 Oct 2011 10:44:52 -0300
Subject: Re: [Seaside] cancelButton using WAButtonTag
To: [hidden email]

Hi, John! Thanks for your quick reply!

Unfortunatelly it doesn't work. Here is my code:

aCanvas button
  bePush;
  callback: self callback;
  script: (aCanvas jQuery this button primaryIcon: 'ui-icon-plus');
  onClick: (aCanvas jQuery ajax serializeThis);
  with: self label.

Is there any other way to disable callbacks execution when a form submits? I've also tried emulating cancelButtons behaviour by wrapping my own callback with WACancelActionCallback it complains about needing a NiladicValuable block.

Thanks again!

On Thu, Oct 20, 2011 at 6:08 PM, John McKeon <[hidden email]> wrote:
Try onClick: (aCanvas jQuery ajax serializeThis);


On Thu, Oct 20, 2011 at 3:12 PM, keropotter <[hidden email]> wrote:
Hi!! I'm developping an application using JQuery decorations, where the
buttons have icons.

I have one button inside a form that's suposed to execute a Task, but I wish
NOT to submit the form by pressing that button given that I do a series of
validations on every input callback. So if the form submits, it fails
because of the validations. I've tried using a #cancelButton but
unfortunately it generates a <input type="button" ...> which doesn't support
JQuery's .button icon styling (which I need in order to keep the layout of
the page)

Is there any way to achieve the same behaviour of cancelButton by using an
ordinary button?

I've tried using a #button bePush; and invoking a callback via ajax, but
that ajax callback doesn't execute the button's callback, where I'm making a
#call: to a WATask. Here's a piece of code for that purpose:

       aCanvas button
               bePush;
               callback: [ self call: MyTask new ];
               script: (aCanvas jQuery this button primaryIcon: 'ui-icon-plus');
               onClick: "I think here I should execute the button's callback"
               with: 'Execute Task'.

Any ideas on how to do this?

Many thanks in advance!!
Alejandro

--
View this message in context: http://forum.world.st/cancelButton-using-WAButtonTag-tp3923147p3923147.html
Sent from the Seaside General mailing list archive at Nabble.com.
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: cancelButton using WAButtonTag

keropotter
Yes, I tried that but it doesn't work. The #call inside the callback has no effect.

So far, the only thing that seems to work is the following:

 "it doesn't submit the form, but executes the button's callback block"

 aCanvas cancelButton
     callback: [ self call: MyTask new ];
     script: (aCanvas jQuery this button primariIcon: 'ui-icon-plus'); " the icon isn't displayed!! =( "
     with: 'Execute Task'.


But it's incompatible with my solution since it doesn't match the needs for the website layout.

Thank you!!
Alejandro

On Fri, Oct 21, 2011 at 12:12 PM, Robert Sirois <[hidden email]> wrote:
You can just put the ajax callback in the click handler.

RS


From: [hidden email]
Date: Fri, 21 Oct 2011 10:44:52 -0300
Subject: Re: [Seaside] cancelButton using WAButtonTag
To: [hidden email]


Hi, John! Thanks for your quick reply!

Unfortunatelly it doesn't work. Here is my code:

aCanvas button
  bePush;
  callback: self callback;
  script: (aCanvas jQuery this button primaryIcon: 'ui-icon-plus');
  onClick: (aCanvas jQuery ajax serializeThis);
  with: self label.

Is there any other way to disable callbacks execution when a form submits? I've also tried emulating cancelButtons behaviour by wrapping my own callback with WACancelActionCallback it complains about needing a NiladicValuable block.

Thanks again!

On Thu, Oct 20, 2011 at 6:08 PM, John McKeon <[hidden email]> wrote:
Try onClick: (aCanvas jQuery ajax serializeThis);


On Thu, Oct 20, 2011 at 3:12 PM, keropotter <[hidden email]> wrote:
Hi!! I'm developping an application using JQuery decorations, where the
buttons have icons.

I have one button inside a form that's suposed to execute a Task, but I wish
NOT to submit the form by pressing that button given that I do a series of
validations on every input callback. So if the form submits, it fails
because of the validations. I've tried using a #cancelButton but
unfortunately it generates a <input type="button" ...> which doesn't support
JQuery's .button icon styling (which I need in order to keep the layout of
the page)

Is there any way to achieve the same behaviour of cancelButton by using an
ordinary button?

I've tried using a #button bePush; and invoking a callback via ajax, but
that ajax callback doesn't execute the button's callback, where I'm making a
#call: to a WATask. Here's a piece of code for that purpose:

       aCanvas button
               bePush;
               callback: [ self call: MyTask new ];
               script: (aCanvas jQuery this button primaryIcon: 'ui-icon-plus');
               onClick: "I think here I should execute the button's callback"
               with: 'Execute Task'.

Any ideas on how to do this?

Many thanks in advance!!
Alejandro

--
View this message in context: http://forum.world.st/cancelButton-using-WAButtonTag-tp3923147p3923147.html
Sent from the Seaside General mailing list archive at Nabble.com.
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside