[Seaside] html update and scriptaculous

Ramon Leon ramon.leon at allresnet.com
Tue Jan 16 23:30:51 UTC 2007


> Hi,
> 
> I'm playing around with scriptaculous and html updater.
> I use checkboxes to display/hide certain parts of the page. 
> In one of the parts I use the Slider from Scriptaculous. 
> There is a problem if the part (containing the slider) is 
> hidden when the page is loaded. Than the slider doesn't work.
> My guess is that scripts are only loaded for visible parts of 
> the page. By only updating the DOM via html updater there is 
> no post-loading of the needed script.
> 
> Is there way to make this work? I hope it isn't necessary to 
> reload the page.
> 
> Norbert

Don't use the updater to show and hide stuff, it's for rendering new content
into the client by making a call back to the server.  That means the content
doesn't exist on the client yet, it's not just hidden, it's not rendered at
all.

To show and hide stuff, use html element not html updater.  

html element id: #someTag; show.

html element id: #someTag; hide.

html element id: #someTag; toggle.

This is also much faster because it simply toggles the display property,
rather than going back to the server.  Just render the content with style:
"display:none" the first time and use the element to show/hide/toggle it.

Ramon Leon
http://onsmalltalk.com  



More information about the Seaside mailing list