lightbox - used in a callback - what am I doing wrong?

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

lightbox - used in a callback - what am I doing wrong?

squeakman
Greetings,

I have a page with an IMG on it and I would like to get a lightbox when
the user clicks on the IMG.  The following test code does not work. I
know that the callback is invoked (using breakpoints) but the lightbox
is not displayed. Can you tell me what I am doing wrong?

--- start of code ---

renderContentOn: html

   html div id: 'image';
     with: [html image url: 'http://localhost/resources/foo.png';
                 onClick: (html evaluator callback: [:script |
                           self lightbox:
                           (SUClassBrowser new newClass: MyTestClass)];
                 return: false)]

--- end of code ---

Thanks,
Frank

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

Re: lightbox - used in a callback - what am I doing wrong?

Sophie424
I believe #lightbox cannot be used within Ajax callbacks, only with full
page redraws.
e.g. Something like this should work:

html anchor
  callback: [ self lightbox:
     (SUClassBrowser new newClass: MyTestClass)];
  with: [html image url: ...]

Hth - Sophie



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

Re: Re: lightbox - used in a callback - what am I doing wrong?

John Thornborrow

itsme213 wrote:
> I believe #lightbox cannot be used within Ajax callbacks, only with full
> page redraws.

This is my understanding too.

> e.g. Something like this should work:
>
> html anchor
>   callback: [ self lightbox:
>      (SUClassBrowser new newClass: MyTestClass)];
>   with: [html image url: ...]
>
> Hth - Sophie
>

That's how I use it.

I'd imagine something like the following could work, but I am merely
brain dumping/storming, I have not even tried, let alone tested it, and
it will need heavy tweaking. CSS wouldn't be pleasant, either:


html div
  id: 'foo';
  style: 'position:absolute;float:left;left:100px;top:100px'.
html anchor
  onClick: (html updater
    id: 'foo';
    callback: [ :ren | ren render: SomeComponent new ]);
    with: 'Show YourComponent'.

Regards,
John

>
>
> _______________________________________________
> 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