[Seaside] jQuery lightbox prompt

Robert Sirois watchlala at hotmail.com
Fri Mar 5 14:39:26 UTC 2010

I'm finally at home and checking e-mail... imagine that. If I'm looking at the same method as you ("#lightbox:" on WAComponent), then what is happening is that a new component (an SULightbox) is being called and the page re-rendered. When you click "ok" (in the example) on the component within the dialog, it is answering true and causes another refresh, and goes away.

Your root component renders the dialog, which renders its content. The components are just changing the way they render, and what it looks like, etc. They are calling that type of behavior delegation.

You can do something similar to this with jQuery, there's just no convenience-like method for it.

For example, on one of my websites I do can do something like this:

html anchor
    callback: [self call: (ToCDLightbox title: 'a title' content: WACounter new)];
    with: 'Test lightbox call jQ'.

where ToCDLightbox looks like:

renderContentOn: html

    html div
        id: self id;
        script: (html jQuery new dialog
            title: self title;
            autoOpen: true;
            modal: true;
            width: 'auto';
            onClose: html jQuery this remove;
            addButton: 'Done' do: html jQuery new dialog close
        with: [
            html render: self content.

This works ok for me, and you could expand on it. In another project of mine I'm working on a mutable UI type system based on dialogs, so there are quite a few more options on my dialog class.

I'm far from proficient at any of this, so maybe Lukas or someone can point out some of my problems or explain this a little better, but I hope this helps.


Date: Fri, 5 Mar 2010 08:04:26 -0500
Subject: Re: [Seaside] jQuery lightbox prompt
From: bobn at rogers.com
To: seaside at lists.squeakfoundation.org

Thanks for looking into it.  
So, if I understand things correctly, there is no equivalent to SULightobx in the Seaside jQuery code; no simple way to replace a #call: with #lightbox: ?  

Oh well, guess it's time to do some learnin' ... always did want to understand more about javascript and how Seaside generates it.  Now I just have to find the time ;-)   

On Mon, Mar 1, 2010 at 10:58 AM, Robert Sirois <watchlala at hotmail.com> wrote:

Im sorry im not very familiar with Scriptaculous. Ive been using a lot of ajax stuff to manipulate elements and return new information to the page without having to call and reload.

It can be a pain keeping track of state, but if what youre doing is purely informational, then its not as big a deal.

Sorry i cant be of more help.

Hotmail: Powerful Free email with security by Microsoft.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100305/e3d80d27/attachment.htm

More information about the seaside mailing list