trapping post before fields are applied to an opject

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

trapping post before fields are applied to an opject

Louis LaBrunda
Hi All,

Is there a way to trap the return from a web page before the attributes of
an object are updated with the values from the web form?  Say one has a
simple form with some fields that are connected to the attributes of an
object with #on:of: and two submit buttons, save and cancel.  Normally one
would make a copy of the object so the original doesn't get modified.  The
callback on the save button would replace the original with the copy.  The
callback on the cancel will discard the copy.

If there is a way to see that the cancel button was clicked BEFORE the
values of the form fields are applied to the object and stop them from
being applied, one wouldn't need a copy of the original object.  The
#on:of:'s could be made to the original object and would be used if the
save button is clicked and not if the cancel button is clicked.

Is there a way to do this now?  If not, would it be hard to add?

Lou
-----------------------------------------------------------
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:[hidden email] http://www.Keystone-Software.com

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

RE: trapping post before fields are applied to an opject

Boris Popov, DeepCove Labs (SNN)
If you make Cancel an anchor, the form data won't even be sent back to
be ignored...

-Boris

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Louis
LaBrunda
Sent: Monday, June 20, 2011 11:07 AM
To: [hidden email]
Subject: [Seaside] trapping post before fields are applied to an opject

Hi All,

Is there a way to trap the return from a web page before the attributes
of an object are updated with the values from the web form?  Say one has
a simple form with some fields that are connected to the attributes of
an object with #on:of: and two submit buttons, save and cancel.
Normally one would make a copy of the object so the original doesn't get
modified.  The callback on the save button would replace the original
with the copy.  The callback on the cancel will discard the copy.

If there is a way to see that the cancel button was clicked BEFORE the
values of the form fields are applied to the object and stop them from
being applied, one wouldn't need a copy of the original object.  The
#on:of:'s could be made to the original object and would be used if the
save button is clicked and not if the cancel button is clicked.

Is there a way to do this now?  If not, would it be hard to add?

Lou
-----------------------------------------------------------
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:[hidden email] http://www.Keystone-Software.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: trapping post before fields are applied to an opject

Julian Fitzell-2
In reply to this post by Louis LaBrunda
WACancelButtonTag (html cancelButton callback: [ ]...) should do what you're looking for?

Julian

On Mon, Jun 20, 2011 at 4:07 PM, Louis LaBrunda <[hidden email]> wrote:
Hi All,

Is there a way to trap the return from a web page before the attributes of
an object are updated with the values from the web form?  Say one has a
simple form with some fields that are connected to the attributes of an
object with #on:of: and two submit buttons, save and cancel.  Normally one
would make a copy of the object so the original doesn't get modified.  The
callback on the save button would replace the original with the copy.  The
callback on the cancel will discard the copy.

If there is a way to see that the cancel button was clicked BEFORE the
values of the form fields are applied to the object and stop them from
being applied, one wouldn't need a copy of the original object.  The
#on:of:'s could be made to the original object and would be used if the
save button is clicked and not if the cancel button is clicked.

Is there a way to do this now?  If not, would it be hard to add?

Lou
-----------------------------------------------------------
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:[hidden email] http://www.Keystone-Software.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
|

trapping post before fields are applied to an opject

Louis LaBrunda
Thank you Boris & Julian for your very prompt replies.

I think I will go with Julian's suggestion as it looks like it more closely
matches what I am doing but Boris' suggestion is also interesting.

Thanks again, Lou

On Mon, 20 Jun 2011 16:13:17 +0100, Julian Fitzell <[hidden email]>
wrote:
>WACancelButtonTag (html cancelButton callback: [ ]...) should do what you're
>looking for?
>Julian
-----------------------------------------------------------
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:[hidden email] http://www.Keystone-Software.com

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