onClick request

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

onClick request

NorbertHartl
Hi,

I like to produce an onClick handler which has a callback.
The callback just needs to reload the page as usual. It
sounds relatively easy to me but I didn't find anything
how to accomplish that.

thanks,

Norbert

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

Re: onClick request

Philippe Marschall
2007/5/23, Norbert Hartl <[hidden email]>:
> Hi,
>
> I like to produce an onClick handler which has a callback.
> The callback just needs to reload the page as usual. It
> sounds relatively easy to me but I didn't find anything
> how to accomplish that.

That's in general the default behavior of an #anchor or #button with
an empty #callback: block so I guess you have special requirements.
Could you elaborate a bit?

Cheers
Philippe

> thanks,
>
> Norbert
>
> _______________________________________________
> 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: onClick request

Lukas Renggli
In reply to this post by NorbertHartl
> I like to produce an onClick handler which has a callback.
> The callback just needs to reload the page as usual. It
> sounds relatively easy to me but I didn't find anything
> how to accomplish that.

html anchor
    onClick: (html evaluator
        callback: [ :s |
           "your callback code"
           s refresh ])

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: onClick request

NorbertHartl
In reply to this post by Philippe Marschall
On Wed, 2007-05-23 at 13:01 +0200, Philippe Marschall wrote:

> 2007/5/23, Norbert Hartl <[hidden email]>:
> > Hi,
> >
> > I like to produce an onClick handler which has a callback.
> > The callback just needs to reload the page as usual. It
> > sounds relatively easy to me but I didn't find anything
> > how to accomplish that.
>
> That's in general the default behavior of an #anchor or #button with
> an empty #callback: block so I guess you have special requirements.
> Could you elaborate a bit?
>
I have a tableRow which is sensitive to mouseOver and mouseOut.
By onClick I want to load the item from the row but it isn't
allowed to have an anchor around a tableRow.

Norbert

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

Re: onClick request

Peter Osburg-2
In reply to this post by NorbertHartl
maybe u try to put the content of the row into a span. then u can use the "onClick" message on that span, like lukas said

Norbert Hartl schrieb:
On Wed, 2007-05-23 at 13:01 +0200, Philippe Marschall wrote:
2007/5/23, Norbert Hartl <[hidden email]>:
Hi,

I like to produce an onClick handler which has a callback.
The callback just needs to reload the page as usual. It
sounds relatively easy to me but I didn't find anything
how to accomplish that.
That's in general the default behavior of an #anchor or #button with

an empty #callback: block so I guess you have special requirements.
Could you elaborate a bit?

I have a tableRow which is sensitive to mouseOver and mouseOut. 
By onClick I want to load the item from the row but it isn't
allowed to have an anchor around a tableRow.

Norbert

_______________________________________________
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: onClick request

NorbertHartl
On Wed, 2007-05-23 at 13:10 +0200, Peter Osburg wrote:
> maybe u try to put the content of the row into a span. then u can use
> the "onClick" message on that span, like lukas said
>
I can use the onClick of the tableRow. I just don't know what
to use with onClick: to assign a callback to it.

Norbert

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

Re: onClick request

NorbertHartl
In reply to this post by Philippe Marschall
On Wed, 2007-05-23 at 13:01 +0200, Philippe Marschall wrote:

> 2007/5/23, Norbert Hartl <[hidden email]>:
> > Hi,
> >
> > I like to produce an onClick handler which has a callback.
> > The callback just needs to reload the page as usual. It
> > sounds relatively easy to me but I didn't find anything
> > how to accomplish that.
>
> That's in general the default behavior of an #anchor or #button with
> an empty #callback: block so I guess you have special requirements.
> Could you elaborate a bit?
>
Ah, ok, I was very unclear on this. I want to load a new page
with the callback. Not just reloading the page displayed.


Norbert

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

Re: onClick request

Lukas Renggli
In reply to this post by NorbertHartl
> I can use the onClick of the tableRow. I just don't know what
> to use with onClick: to assign a callback to it.

As I showed in my previous mail.

One could even do it without the use of 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: onClick request

Lukas Renggli
> One could even do it without the use of Scriptaculous.

Have a look at how WAAnchor creates the callback URL:

url := html context actionUrl withParameter: (html callbacks
   registerActionCallback: [ .... ]).
html tableRow onClick: 'window.location=' , url printString.

--
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: Spam:Spam:Re: onClick request

Bany, Michel
#urlForAction: that used to be available in the old api is also
available for the canvas api in recent 2.6/2.7

urlForAction: actionBlock
        | url |
        url := context actionUrl withParameter: (self callbacks
registerActionCallback: actionBlock).
        ^url displayString

With this method the code gets simpler

url := html urlForAction: [ .... ]
html tableRow onClick: 'window.location=' , url printString.


HTH
Michel.


> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf
> Of Lukas Renggli
> Sent: mercredi, 23. mai 2007 13:22
> To: Seaside - general discussion
> Subject: Spam:Spam:Re: [Seaside] onClick request
>
> > One could even do it without the use of Scriptaculous.
>
> Have a look at how WAAnchor creates the callback URL:
>
> url := html context actionUrl withParameter: (html callbacks
>    registerActionCallback: [ .... ]).
> html tableRow onClick: 'window.location=' , url printString.
>
> --
> 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: Spam:Spam:Re: onClick request

NorbertHartl
On Wed, 2007-05-23 at 12:41 +0100, Bany, Michel wrote:

> #urlForAction: that used to be available in the old api is also
> available for the canvas api in recent 2.6/2.7
>
> urlForAction: actionBlock
> | url |
> url := context actionUrl withParameter: (self callbacks
> registerActionCallback: actionBlock).
> ^url displayString
>
> With this method the code gets simpler
>
> url := html urlForAction: [ .... ]
> html tableRow onClick: 'window.location=' , url printString.
>
>
I don't have urlForAction: in the canvas.

thanks,

Norbert

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

Re: onClick request

NorbertHartl
In reply to this post by Lukas Renggli
On Wed, 2007-05-23 at 13:21 +0200, Lukas Renggli wrote:
> > One could even do it without the use of Scriptaculous.
>
> Have a look at how WAAnchor creates the callback URL:
>
> url := html context actionUrl withParameter: (html callbacks
>    registerActionCallback: [ .... ]).
> html tableRow onClick: 'window.location=' , url printString.

Ok, but in my case there is no printSting in WAUrl. I have to
use asString which is working.

Norbert

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

Re: onClick request

Philippe Marschall
2007/5/23, Norbert Hartl <[hidden email]>:

> On Wed, 2007-05-23 at 13:21 +0200, Lukas Renggli wrote:
> > > One could even do it without the use of Scriptaculous.
> >
> > Have a look at how WAAnchor creates the callback URL:
> >
> > url := html context actionUrl withParameter: (html callbacks
> >    registerActionCallback: [ .... ]).
> > html tableRow onClick: 'window.location=' , url printString.
>
> Ok, but in my case there is no printSting in WAUrl. I have to
> use asString which is working.

Michel probably meant #displayString.

Cheers
Philippe

> Norbert
>
> _______________________________________________
> 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: onClick request

Lukas Renggli
In reply to this post by NorbertHartl
> > Have a look at how WAAnchor creates the callback URL:
> >
> > url := html context actionUrl withParameter: (html callbacks
> >    registerActionCallback: [ .... ]).
> > html tableRow onClick: 'window.location=' , url printString.
>
> Ok, but in my case there is no printSting in WAUrl. I have to
> use asString which is working.

Sure, I always implicitly say: "Something along the lines should work ..."

--
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: Spam:Spam:Re: onClick request

Michel Bany
In reply to this post by NorbertHartl

On 23 May 2007, at 15:16 , Norbert Hartl wrote:

> On Wed, 2007-05-23 at 12:41 +0100, Bany, Michel wrote:
>> #urlForAction: that used to be available in the old api is also
>> available for the canvas api in recent 2.6/2.7
>>
>> urlForAction: actionBlock
>> | url |
>> url := context actionUrl withParameter: (self callbacks
>> registerActionCallback: actionBlock).
>> ^url displayString
>>
>> With this method the code gets simpler
>>
>> url := html urlForAction: [ .... ]
>> html tableRow onClick: 'window.location=' , url printString.
>>
>>
> I don't have urlForAction: in the canvas.
>

Sorry, my mistake, it is only in the latest 2.7b1.
What Seaside are you using?
Michel.


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

Re: onClick request

Michel Bany
In reply to this post by NorbertHartl

On 23 May 2007, at 15:17 , Norbert Hartl wrote:

> On Wed, 2007-05-23 at 13:21 +0200, Lukas Renggli wrote:
>>> One could even do it without the use of Scriptaculous.
>>
>> Have a look at how WAAnchor creates the callback URL:
>>
>> url := html context actionUrl withParameter: (html callbacks
>>    registerActionCallback: [ .... ]).
>> html tableRow onClick: 'window.location=' , url printString.
>
> Ok, but in my case there is no printSting in WAUrl. I have to
> use asString which is working.

FWIW, #printString is meant to surround the url with double quotes.


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

Re: Spam:Spam:Re: onClick request

NorbertHartl
In reply to this post by Michel Bany
On Wed, 2007-05-23 at 15:54 +0200, Michel Bany wrote:

> On 23 May 2007, at 15:16 , Norbert Hartl wrote:
>
> > On Wed, 2007-05-23 at 12:41 +0100, Bany, Michel wrote:
> >> #urlForAction: that used to be available in the old api is also
> >> available for the canvas api in recent 2.6/2.7
> >>
> >> urlForAction: actionBlock
> >> | url |
> >> url := context actionUrl withParameter: (self callbacks
> >> registerActionCallback: actionBlock).
> >> ^url displayString
> >>
> >> With this method the code gets simpler
> >>
> >> url := html urlForAction: [ .... ]
> >> html tableRow onClick: 'window.location=' , url printString.
> >>
> >>
> > I don't have urlForAction: in the canvas.
> >
>
> Sorry, my mistake, it is only in the latest 2.7b1.
> What Seaside are you using?
> Michel.
>
Seaside 2.7a1-207

Norbert

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

Re: onClick request

NorbertHartl
In reply to this post by Michel Bany
On Wed, 2007-05-23 at 15:56 +0200, Michel Bany wrote:

> On 23 May 2007, at 15:17 , Norbert Hartl wrote:
>
> > On Wed, 2007-05-23 at 13:21 +0200, Lukas Renggli wrote:
> >>> One could even do it without the use of Scriptaculous.
> >>
> >> Have a look at how WAAnchor creates the callback URL:
> >>
> >> url := html context actionUrl withParameter: (html callbacks
> >>    registerActionCallback: [ .... ]).
> >> html tableRow onClick: 'window.location=' , url printString.
> >
> > Ok, but in my case there is no printSting in WAUrl. I have to
> > use asString which is working.
>
> FWIW, #printString is meant to surround the url with double quotes.
>
>
Ah, ok, I had to do this manually.

Norbert

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

Re: onClick request

NorbertHartl
In reply to this post by Lukas Renggli
On Wed, 2007-05-23 at 15:31 +0200, Lukas Renggli wrote:

> > > Have a look at how WAAnchor creates the callback URL:
> > >
> > > url := html context actionUrl withParameter: (html callbacks
> > >    registerActionCallback: [ .... ]).
> > > html tableRow onClick: 'window.location=' , url printString.
> >
> > Ok, but in my case there is no printSting in WAUrl. I have to
> > use asString which is working.
>
> Sure, I always implicitly say: "Something along the lines should work ..."

I know. This wasn't a complaint ;) But I find it useful to answer
this way for the records. This way it gets archived and the next
one which has this problem doesn't have to stumple upon the same
problem.

Norbert

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

Re: Spam:Spam:Re: onClick request

Michel Bany
In reply to this post by NorbertHartl

On 23 May 2007, at 16:07 , Norbert Hartl wrote:

> On Wed, 2007-05-23 at 15:54 +0200, Michel Bany wrote:
>> On 23 May 2007, at 15:16 , Norbert Hartl wrote:
>>
>>> On Wed, 2007-05-23 at 12:41 +0100, Bany, Michel wrote:
>>>> #urlForAction: that used to be available in the old api is also
>>>> available for the canvas api in recent 2.6/2.7
>>>>
>>>> urlForAction: actionBlock
>>>> | url |
>>>> url := context actionUrl withParameter: (self callbacks
>>>> registerActionCallback: actionBlock).
>>>> ^url displayString
>>>>
>>>> With this method the code gets simpler
>>>>
>>>> url := html urlForAction: [ .... ]
>>>> html tableRow onClick: 'window.location=' , url printString.
>>>>
>>>>
>>> I don't have urlForAction: in the canvas.
>>>
>>
>> Sorry, my mistake, it is only in the latest 2.7b1.
>> What Seaside are you using?
>> Michel.
>>
> Seaside 2.7a1-207

You should not expect any special problem if you upgrade to 2.7b1-3,  
I believe.
Your decision...
Michel.


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