Using updater without triggering action callback?

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

Using updater without triggering action callback?

Boris Popov, DeepCove Labs (SNN)
Say you have a form with default action callback to run a search. One of
the criteria for this search is specified using a select list in that
form. Now I'd like to attach an updater to the select list to populate a
little "extras" div to the side of it with selection details, but I
would like to do so without triggering the default action of a form that
would actually execute the search?

(html select)
 list: self accounts;
 labels: [:acc | acc name];
 selected: self account;
 callback: [:value | self account: value];
 onChange: ((html updater)
                id: divid;
                triggerForm: formid;
                callback: [:r | r span: self account name])
(html div)
  id: divid;
  with: [].

Thanks,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

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

RE: Using updater without triggering action callback?

Boris Popov, DeepCove Labs (SNN)
Also, to see exactly what I'm talking about, just add (defaultAction:
[]) to the form in SUFormTest>>renderLabel:control:model:on: then play
with examples, specifically select list, but all others exhibit the same
behavior.

Thanks!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: Boris Popov
> Sent: Thursday, August 23, 2007 12:58 PM
> To: 'Seaside - general discussion'
> Subject: Using updater without triggering action callback?
>
> Say you have a form with default action callback to run a search. One
of
> the criteria for this search is specified using a select list in that
> form. Now I'd like to attach an updater to the select list to populate
a
> little "extras" div to the side of it with selection details, but I
would
> like to do so without triggering the default action of a form that
would

> actually execute the search?
>
> (html select)
>  list: self accounts;
>  labels: [:acc | acc name];
>  selected: self account;
>  callback: [:value | self account: value];
>  onChange: ((html updater)
>                 id: divid;
>                 triggerForm: formid;
>                 callback: [:r | r span: self account name])
> (html div)
>   id: divid;
>   with: [].
>
> Thanks,
>
> -Boris
>
> --
> +1.604.689.0322
> DeepCove Labs Ltd.
> 4th floor 595 Howe Street
> Vancouver, Canada V6C 2T5
> http://tinyurl.com/r7uw4
>
> [hidden email]
>
> CONFIDENTIALITY NOTICE
>
> This email is intended only for the persons named in the message
> header. Unless otherwise indicated, it contains information that is
> private and confidential. If you have received it in error, please
> notify the sender and delete the entire message including any
> attachments.
>
> Thank you.

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

RE: RE: Using updater without triggering action callback?

Boris Popov, DeepCove Labs (SNN)
It almost seems that if we used a different kind of callback for that
"default" submit button on a form and ignored it during the callback
processing when isXmlHttpRequest = true that might fix it, although now
we've got to think if this is ever desirable, and so far (given the
ugliness of the result) I can't think of any cases when this might be
so.

Thoughts?

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Boris Popov
> Sent: Thursday, August 23, 2007 1:04 PM
> To: Seaside - general discussion
> Subject: [Seaside] RE: Using updater without triggering action
callback?
>
> Also, to see exactly what I'm talking about, just add (defaultAction:
> []) to the form in SUFormTest>>renderLabel:control:model:on: then play
> with examples, specifically select list, but all others exhibit the
same

> behavior.
>
> Thanks!
>
> -Boris
>
> --
> +1.604.689.0322
> DeepCove Labs Ltd.
> 4th floor 595 Howe Street
> Vancouver, Canada V6C 2T5
> http://tinyurl.com/r7uw4
>
> [hidden email]
>
> CONFIDENTIALITY NOTICE
>
> This email is intended only for the persons named in the message
> header. Unless otherwise indicated, it contains information that is
> private and confidential. If you have received it in error, please
> notify the sender and delete the entire message including any
> attachments.
>
> Thank you.
>
> > -----Original Message-----
> > From: Boris Popov
> > Sent: Thursday, August 23, 2007 12:58 PM
> > To: 'Seaside - general discussion'
> > Subject: Using updater without triggering action callback?
> >
> > Say you have a form with default action callback to run a search.
One
> of
> > the criteria for this search is specified using a select list in
that
> > form. Now I'd like to attach an updater to the select list to
populate

> a
> > little "extras" div to the side of it with selection details, but I
> would
> > like to do so without triggering the default action of a form that
> would
> > actually execute the search?
> >
> > (html select)
> >  list: self accounts;
> >  labels: [:acc | acc name];
> >  selected: self account;
> >  callback: [:value | self account: value];
> >  onChange: ((html updater)
> >                 id: divid;
> >                 triggerForm: formid;
> >                 callback: [:r | r span: self account name])
> > (html div)
> >   id: divid;
> >   with: [].
> >
> > Thanks,
> >
> > -Boris
> >
> > --
> > +1.604.689.0322
> > DeepCove Labs Ltd.
> > 4th floor 595 Howe Street
> > Vancouver, Canada V6C 2T5
> > http://tinyurl.com/r7uw4
> >
> > [hidden email]
> >
> > CONFIDENTIALITY NOTICE
> >
> > This email is intended only for the persons named in the message
> > header. Unless otherwise indicated, it contains information that is
> > private and confidential. If you have received it in error, please
> > notify the sender and delete the entire message including any
> > attachments.
> >
> > Thank you.
>
> _______________________________________________
> 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: Using updater without triggering action callback?

Andrius Paulavicius
In reply to this post by Boris Popov, DeepCove Labs (SNN)
why not just seperate selection and text input into two seperate forms?

----- Original Message -----
From: "Boris Popov" <[hidden email]>
To: "Seaside - general discussion" <[hidden email]>
Sent: Thursday, August 23, 2007 10:57 PM
Subject: [Seaside] Using updater without triggering action callback?


Say you have a form with default action callback to run a search. One of
the criteria for this search is specified using a select list in that
form. Now I'd like to attach an updater to the select list to populate a
little "extras" div to the side of it with selection details, but I
would like to do so without triggering the default action of a form that
would actually execute the search?

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

RE: Using updater without triggering action callback?

Boris Popov, DeepCove Labs (SNN)
Simply because search criteria form includes a number of fields and
submitting half of it would do no good for actually executing a search
with only half the query parameters set later on. Or say you only have a
single select list + button on a form, and you'd like it to have default
action. This is a bug IMHO, not a feature.

Cheers!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Andrius Paulavicius
> Sent: Thursday, August 23, 2007 1:48 PM
> To: Seaside - general discussion
> Subject: Re: [Seaside] Using updater without triggering action
callback?
>
> why not just seperate selection and text input into two seperate
forms?
>
> ----- Original Message -----
> From: "Boris Popov" <[hidden email]>
> To: "Seaside - general discussion"
<[hidden email]>
> Sent: Thursday, August 23, 2007 10:57 PM
> Subject: [Seaside] Using updater without triggering action callback?
>
>
> Say you have a form with default action callback to run a search. One
of
> the criteria for this search is specified using a select list in that
> form. Now I'd like to attach an updater to the select list to populate
a
> little "extras" div to the side of it with selection details, but I
> would like to do so without triggering the default action of a form
that
> would actually execute the search?
>
> _______________________________________________
> 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: Using updater without triggering action callback?

Lukas Renggli
> Simply because search criteria form includes a number of fields and
> submitting half of it would do no good for actually executing a search
> with only half the query parameters set later on. Or say you only have a
> single select list + button on a form, and you'd like it to have default
> action. This is a bug IMHO, not a feature.

The easiest solution for your problem would be to write in your
default action block something like:

     self session currentRequest isXmlHttpRequest
          ifFalse: [ " default action code " ]

I am not really sure if we want this as a default. There are several
problem serializing hidden-fields, buttons and some of the "composed
form elements" like checkboxes and multi-select lists (some of these
problems have been fixed in 2.8).

Maybe you could also trigger in your drop-down just the relevant form
elements using a cascade of #triggerFormElement:. Note this also works
for multiple forms, etc.

Lukas

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

RE: Using updater without triggering action callback?

Boris Popov, DeepCove Labs (SNN)
Lukas,

That was my first reaction as well and I did try to suppressing the
callback from the inside, however it's really the render notification
signal that immediately follows that will screw things up even if I
don't actually do anything in the callback itself as demonstrated by my
later suggestion of adding an empty callback to SUFormTest to be able to
see the mayhem. It seems there should be a general solution to this and
the more I think about it the more I lean towards trying to suppress
execution of that single callback altogether to see if that fixes the
problem but I can't think of a clean way of tagging it as such quite
yet.

Thanks,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Lukas Renggli
> Sent: Thursday, August 23, 2007 2:26 PM
> To: Seaside - general discussion
> Subject: Re: [Seaside] Using updater without triggering action
callback?
>
> > Simply because search criteria form includes a number of fields and
> > submitting half of it would do no good for actually executing a
search
> > with only half the query parameters set later on. Or say you only
have a
> > single select list + button on a form, and you'd like it to have
default

> > action. This is a bug IMHO, not a feature.
>
> The easiest solution for your problem would be to write in your
> default action block something like:
>
>      self session currentRequest isXmlHttpRequest
>           ifFalse: [ " default action code " ]
>
> I am not really sure if we want this as a default. There are several
> problem serializing hidden-fields, buttons and some of the "composed
> form elements" like checkboxes and multi-select lists (some of these
> problems have been fixed in 2.8).
>
> Maybe you could also trigger in your drop-down just the relevant form
> elements using a cascade of #triggerFormElement:. Note this also works
> for multiple forms, etc.
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> 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: Using updater without triggering action callback?

Lukas Renggli
> That was my first reaction as well and I did try to suppressing the
> callback from the inside, however it's really the render notification
> signal that immediately follows that will screw things up even if I
> don't actually do anything in the callback itself as demonstrated by my
> later suggestion of adding an empty callback to SUFormTest to be able to
> see the mayhem. It seems there should be a general solution to this and
> the more I think about it the more I lean towards trying to suppress
> execution of that single callback altogether to see if that fixes the
> problem but I can't think of a clean way of tagging it as such quite
> yet.

I am sorry, I was probably reading your mail not careful enough ...

Fact is that I changed the way and order in which callbacks are
evaluated a few weeks ago after that discussion about the handing of
submit buttons and AJAX form serialization. It seems that these fixes
also solve your problem and does not even require a test for
#isXmlHttpRequest. So I suggest that you update to the latest version
of Seaside 2.8 and Scriptaculous.

Lukas

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

Re: Using updater without triggering action callback?

Boris Popov, DeepCove Labs (SNN)
In reply to this post by Boris Popov, DeepCove Labs (SNN)
Re: [Seaside] Using updater without triggering action callback?

Ah, cool, I will give them a try when Michel gets a chance to push the latest to visualworks, I'm not sure what version I am at currently.

Thanks!

Cheers!

-Boris
(Sent from a BlackBerry)

----- Original Message -----
From: [hidden email] <[hidden email]>
To: Seaside - general discussion <[hidden email]>
Sent: Thu Aug 23 22:39:36 2007
Subject: Re: [Seaside] Using updater without triggering action callback?

> That was my first reaction as well and I did try to suppressing the
> callback from the inside, however it's really the render notification
> signal that immediately follows that will screw things up even if I
> don't actually do anything in the callback itself as demonstrated by my
> later suggestion of adding an empty callback to SUFormTest to be able to
> see the mayhem. It seems there should be a general solution to this and
> the more I think about it the more I lean towards trying to suppress
> execution of that single callback altogether to see if that fixes the
> problem but I can't think of a clean way of tagging it as such quite
> yet.

I am sorry, I was probably reading your mail not careful enough ...

Fact is that I changed the way and order in which callbacks are
evaluated a few weeks ago after that discussion about the handing of
submit buttons and AJAX form serialization. It seems that these fixes
also solve your problem and does not even require a test for
#isXmlHttpRequest. So I suggest that you update to the latest version
of Seaside 2.8 and Scriptaculous.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
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: Using updater without triggering action callback?

Lukas Renggli
> Ah, cool, I will give them a try when Michel gets a chance to push the
> latest to visualworks, I'm not sure what version I am at currently.

It is probably not ported yet. This change came with
Seaside2.8a1-lr.432 at the 8 August 2007, 6:17:01 pm. What it does is
to introduce a new kind of callback handler, not for the buttons and
default-actions but for the AJAX request itself.

Lukas

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

RE: Using updater without triggering action callback?

Boris Popov, DeepCove Labs (SNN)
Thanks, I'm on 426 at the moment, which is the latest in Public
Repository.

/me pokes Michel and Michael to find out how far along they may be on
the path of automatic ports being made available to VisualWorks users
like myself

;)

Thanks!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Lukas Renggli
> Sent: Thursday, August 23, 2007 10:48 PM
> To: Seaside - general discussion
> Subject: Re: [Seaside] Using updater without triggering action
callback?
>
> > Ah, cool, I will give them a try when Michel gets a chance to push
the

> > latest to visualworks, I'm not sure what version I am at currently.
>
> It is probably not ported yet. This change came with
> Seaside2.8a1-lr.432 at the 8 August 2007, 6:17:01 pm. What it does is
> to introduce a new kind of callback handler, not for the buttons and
> default-actions but for the AJAX request itself.
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> 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