[Seaside] Re: jQuery lightbox flashes on but doesn't stick around
inside a form
jfitzell at gmail.com
Wed Jul 22 18:11:25 UTC 2009
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:
onClick: ((html jQuery id: id) dialog open; return: false);
(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:
onClick: (html jQuery id: id) dialog open;
On Wed, Jul 22, 2009 at 9:30 AM, Paul DeBruicker<pdebruic at gmail.com> 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
> On Wed, Jul 22, 2009 at 12:26 PM, Paul DeBruicker<pdebruic at gmail.com> 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
> seaside at lists.squeakfoundation.org
More information about the seaside