jQuery lightbox flashes on but doesn't stick around inside a form

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

jQuery lightbox flashes on but doesn't stick around inside a form

Paul DeBruicker
Hi -

This works as expected:

renderContentOn: html
    self renderLightboxOn: html

renderLightboxOn: html
        | id |
        html div
                id: (id := html nextId);
                script: (html jQuery new dialog
                                title: 'Welcome Back!';
                                html: [ html text: 'Hi' ];
                                resizable: false;
                                modal: true).
        ^ html submitButton
                onClick: (html jQuery id: id) dialog open;
                with: 'Hi'


why does this only flash the lightbox without showing the contents:

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

Re: jQuery lightbox flashes on but doesn't stick around inside a form

Paul DeBruicker
Oops.. fat fingers.

renderContentOn: html
html form: [self renderLightboxOn: html].

I don't understand why wrapping the renderLightboxOn: method in a form
causes the lightbox to briefly display on the screen.  It seems to
happen when other form elements are in the form as well like textInput
or checkboxes etc.

This is Seaside - 2.9a4

Thanks in advance
Paul




On Wed, Jul 22, 2009 at 12:26 PM, Paul DeBruicker<[hidden email]> wrote:

> Hi -
>
> This works as expected:
>
> renderContentOn: html
>    self renderLightboxOn: html
>
> renderLightboxOn: html
>        | id |
>        html div
>                id: (id := html nextId);
>                script: (html jQuery new dialog
>                                title: 'Welcome Back!';
>                                html: [ html text: 'Hi' ];
>                                resizable: false;
>                                modal: true).
>        ^ html submitButton
>                onClick: (html jQuery id: id) dialog open;
>                with: 'Hi'
>
>
> why does this only flash the lightbox without showing the contents:
>
> renderContentOnL html
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: jQuery lightbox flashes on but doesn't stick around inside a form

Julian Fitzell-2
When you put the button in a form, then clicking it actually results
in the page being submitted. So your dialog is displayed but then a
new page is immediately loaded (you should see the URL change).

In order to abort the normal effect of the submit button, you need
your onclick to return false. You could do:

html submitButton
               onClick: ((html jQuery id: id) dialog open; return: false);
               with: 'Hi'

(note that returning the result of this expression from your render
method as you are doing is a bit weird)

Or, probably better, don't use a submit button at all:

html button
               bePush;
               onClick: (html jQuery id: id) dialog open;
               with: 'Hi'

Julian

On Wed, Jul 22, 2009 at 9:30 AM, Paul DeBruicker<[hidden email]> wrote:

> Oops.. fat fingers.
>
> renderContentOn: html
> html form: [self renderLightboxOn: html].
>
> I don't understand why wrapping the renderLightboxOn: method in a form
> causes the lightbox to briefly display on the screen.  It seems to
> happen when other form elements are in the form as well like textInput
> or checkboxes etc.
>
> This is Seaside - 2.9a4
>
> Thanks in advance
> Paul
>
>
>
>
> On Wed, Jul 22, 2009 at 12:26 PM, Paul DeBruicker<[hidden email]> wrote:
>> Hi -
>>
>> This works as expected:
>>
>> renderContentOn: html
>>    self renderLightboxOn: html
>>
>> renderLightboxOn: html
>>        | id |
>>        html div
>>                id: (id := html nextId);
>>                script: (html jQuery new dialog
>>                                title: 'Welcome Back!';
>>                                html: [ html text: 'Hi' ];
>>                                resizable: false;
>>                                modal: true).
>>        ^ html submitButton
>>                onClick: (html jQuery id: id) dialog open;
>>                with: 'Hi'
>>
>>
>> why does this only flash the lightbox without showing the contents:
>>
>> renderContentOnL html
>>
> _______________________________________________
> 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