Scripaculous toggle

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

Scripaculous toggle

Esteban A. Maringolo
Hi,

I'm using the scriptaculous Toggle effect with success (thanks Lukas),
what I want to do now is to notify my component when the toggle has
been activated, store its state (hidden/visible), and when the
component is rendered again, use the stored state by default.

Two questions:
1) What is the way to have 2 SU actions in the onClick event?
One being the toggle, an other a XHR callback to the component,
notifying about the new layout.

2) How to set the hidden/visible status of the "toggled" element
during the render, but leaving it enabled for a future toggle.

Thanks in advance.

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

Re: Scripaculous toggle

Esteban A. Maringolo
Answering myself:

On Jan 4, 2008 2:23 PM, Esteban A. Maringolo <[hidden email]> wrote:
> Two questions:
> 1) What is the way to have 2 SU actions in the onClick event?
> One being the toggle, an other a XHR callback to the component,
> notifying about the new layout.

This is pending... yet.

> 2) How to set the hidden/visible status of the "toggled" element
> during the render, but leaving it enabled for a future toggle.

I've had to inline the 'display: none' style of the affected element.


ps: I can't write Scriptaculous name right two times in a row. :-) (see subject)

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

Re: Re: Scripaculous toggle

EstebanLM


On Jan 4, 2008 3:38 PM, Esteban A. Maringolo <[hidden email]> wrote:
Answering myself:

On Jan 4, 2008 2:23 PM, Esteban A. Maringolo <[hidden email]> wrote:
> Two questions:
> 1) What is the way to have 2 SU actions in the onClick event?
> One being the toggle, an other a XHR callback to the component,
> notifying about the new layout.

This is pending... yet.

Mmm, I'm using "comma", like this: 

html anchor
onClick: 
(html element id: detailtId; toggle) , 
(html updater id: detailtId; 
callback: [:render | 
render render: (childs add: (self post asShow part: self) )]),
(html updater id: titleId;
callback: [:render| 
self updateMarks.
self renderTitleOn: render ]);
with: self post name.

It's not the best solution, i think (component is updated even when hidding), but works... :)  

> 2) How to set the hidden/visible status of the "toggled" element
> during the render, but leaving it enabled for a future toggle.

I've had to inline the 'display: none' style of the affected element.


ps: I can't write Scriptaculous name right two times in a row. :-) (see subject)

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



--
"Querer es suscitar las paradojas"
Camus. El míto de Sísifo.
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Scripaculous toggle

Esteban A. Maringolo
Hola Esteban:

On Jan 4, 2008 2:50 PM, Esteban Lorenzano <[hidden email]> wrote:

> > On Jan 4, 2008 2:23 PM, Esteban A. Maringolo <[hidden email]> wrote:
> > > Two questions:
> > > 1) What is the way to have 2 SU actions in the onClick event?
> > > One being the toggle, an other a XHR callback to the component,
> > > notifying about the new layout.
> >
> > This is pending... yet.

> Mmm, I'm using "comma", like this:

>  html anchor
>  onClick:
>  (html element id: detailtId; toggle) ,
>  (html updater id: detailtId;
>  callback: [:render |
>  render render: (childs add: (self post asShow part: self) )]),
>  (html updater id: titleId;
>  callback: [:render|
>  self updateMarks.
>  self renderTitleOn: render ]);
>  with: self post name.

Simple, and effective.

> It's not the best solution, i think (component is updated even when
> hidding), but works... :)

It is possible to make a XHR with no answer? I'm not interested in the
response content, by now SURequest does the job, but answers a lot of
content (mostly html headers). What is the specific class of the
technique to achieve this objective?

Best regards,


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

Re: Re: Scripaculous toggle

Lukas Renggli
> > It's not the best solution, i think (component is updated even when
> > hidding), but works... :)
>
> It is possible to make a XHR with no answer? I'm not interested in the
> response content, by now SURequest does the job,

HTTP always expects an answer for a request, this is the same for XHR.
Since XHR is asynchronous and since SURequest does not associate any
JavaScript handlers any data coming back is just ignored.

> but answers a lot of
> content (mostly html headers). What is the specific class of the
> technique to achieve this objective?

What content? There is something wrong with you setup.

In Squeak with Kom it answers:

      HTTP/1.1 200 OK
      Date: Mon, 07 Jan 2008 15:17:41 GMT
      Connection: close
      Server: Comanche/6.2 (Mac OS)
      Cache-Control: no-cache
      Content-type: text/html;charset=utf-8
      Content-length: 0

A few fields could be removed for sure, but otherwise and as far as I
know this is sort of a minimal valid response.

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: Re: Scripaculous toggle

Esteban A. Maringolo
Hi Lukas.

On Jan 7, 2008 11:25 AM, Lukas Renggli <[hidden email]> wrote:
> > > It's not the best solution, i think (component is updated even when
> > > hidding), but works... :)
> >
> > It is possible to make a XHR with no answer? I'm not interested in the
> > response content, by now SURequest does the job,
>
> HTTP always expects an answer for a request, this is the same for XHR.
> Since XHR is asynchronous and since SURequest does not associate any
> JavaScript handlers any data coming back is just ignored.

What I want is the data coming back be small as possible.

> > but answers a lot of
> > content (mostly html headers). What is the specific class of the
> > technique to achieve this objective?
>
> What content? There is something wrong with you setup.
>
> In Squeak with Kom it answers:
>       HTTP/1.1 200 OK
>       Date: Mon, 07 Jan 2008 15:17:41 GMT
>       Connection: close
>       Server: Comanche/6.2 (Mac OS)
>       Cache-Control: no-cache
>       Content-type: text/html;charset=utf-8
>       Content-length: 0

According to FireBug's XHR inspector ("Net" tool), this is the HTTP
response header for my request:

Server: Swazoo 2.0 Smalltalk Web Server
Cache-Control: no-cache
Content-Type: text/html;charset=iso-8859-1
Date: Mon, 07 Jan 2008 13:27:55 GMT
Content-Length: 0

But in that response, the size reported by FireBug is 4kb, even when
the HTTP header says zero, and the "Response" tab in that request,
shows a lot of content (that 4kb).

> A few fields could be removed for sure, but otherwise and as far as I
> know this is sort of a minimal valid response.

I'm not obsessed with the HTTP headers, but I am looking how to reduce
the HTML content.

Thank you.

Regards,

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

Re: Re: Scripaculous toggle

Esteban A. Maringolo
Again answering myself...

On Jan 7, 2008 12:34 PM, Esteban A. Maringolo <[hidden email]> wrote:

> On Jan 7, 2008 11:25 AM, Lukas Renggli <[hidden email]> wrote:
> > What content? There is something wrong with you setup.

Apparently there is a bug in some part of the Dolphin port (blame myself).

The content that is returned by the XHR is the default response for my
Seaside component (the root), but with all anchor callbacks URI's,
have a different session key than the one that started the XHR. This
has to be a bug.

I'll keep looking.

Thanks again,


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