[Seaside] Oddness with #lightbox: in VW

Sau Sheong Chang cssheong at pacific.net.sg
Fri Apr 27 14:33:12 UTC 2007


Hi,

This has nothing to do with this post beyond a curious behavior i  
noticed in the lightbox behavior when implemented with Seaside/ 
Squeak. if I call lightbox with a component as a parameter, it will  
render the component as a lightbox, which can be prettied up with  
some CSS. Tthe lightbox that is returned doesn't center in the middle  
of the screen. It centers vertically but not horizontally, in fact it  
veers to the left on popup. However If I resize the window, the  
lightbox corrects itself and centers in the middle of screen. I tried  
this with Firefox under OS X and Windows XP and it behaves the same way.

After some mucking around the code, I discovered that if I change  
this method in SULightbox:

SULightbox>>lighter
	^ 'updateLightbox();window.onresize=function(){updateLightbox();};'

to this

SULightbox>>lighter
	^ 'updateLightbox();updateLightbox();window.onresize=function() 
{updateLightbox();};'


the problem goes away. I know it's a bit hackish and I was wondering  
if there is a better fix for this?

--
Sau Sheong

http://blog.saush.com - brain dump




On 27 Apr 2007, at 1:22 AM, Boris Popov wrote:

> Which version of Seaside and SeasideScriptaculous are you using? There
> was a change in the call/answer recently that I found in my YUI panel
> use and myself and Lukas updated my implementation and his  
> #lightbox: to
> raise a render notification at the end to make it work properly again.
> Its already part of the most recent version in public repository, but
> here's a relevant method that you need,
>
> lightbox: aComponent
> 	^ AnswerContinuation currentDo: [ :cc |
> 		self
> 			show: aComponent
> 			onAnswer: cc
> 			delegation: (Seaside.SULightbox new
> 				delegate: aComponent;
> 				yourself).
> 		WARenderNotification raiseSignal ]
>
> By the way, this #lightbox has nothing to do with AJAX per se; it's  
> just
> a fancy way to render a modal component ;)
>
> Hope this helps,
>
> -Boris
>
> -- 
> +1.604.689.0322
> DeepCove Labs Ltd.
> 4th floor 595 Howe Street
> Vancouver, Canada V6C 2T5
> http://tinyurl.com/r7uw4
>
> boris at deepcovelabs.com
>
> CONFIDENTIALITY NOTICE
>
> This email is intended only for the persons named in the message
> header. Unless otherwise indicated, it contains information that is
> private and confidential. If you have received it in error, please
> notify the sender and delete the entire message including any
> attachments.
>
> Thank you.
>
>> -----Original Message-----
>> From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-
>> bounces at lists.squeakfoundation.org] On Behalf Of Yann Monclair
>> Sent: Thursday, April 26, 2007 9:57 AM
>> To: The Squeak Enterprise Aubergines Server - general discussion.
>> Subject: [Seaside] Oddness with #lightbox: in VW
>>
>> Hi all,
>>
>> I've been playing around with Scriptaculous in VisualWorks, creating
>> a sample application as a demo for co-workers.
>> During the ajax-ication of my application, I came to use #lightbox:
>> instead of #call:
>> Now this lead to an error in my page rendering ( a MNU) and after
>> investigation I found out that, when you do
>>
>> r:=self lightbox: (aComponent).
>> r will first have for value self , then when aComponent will answer,
>> it will have for value the object answered by aComponent.
>>
>> This is not the same behaviour as #lightbox: in Squeak! So I suspect
>> it is a VW problem.
>>
>> I put together a quick test case app, to reproduce the bug.
> (attached)
>>
>> Component1 calls component2. everytime it does a call (with #call: or
>> #lightbox: ) it inspects the value or r. As you will see, with  
>> #call:,
>> r is inspected only once, and has the proper value. With #lightbox: r
>> is inspected twice, first holding self , then holding the proper
> value.
>>
>> I will try to look into the problem myself, but any help is
>> appreciated :)
>>
>> Thanks,
>>
>> Yann Monclair
>>
>> PS: for the lucky people coming to Smalltalk Solutions 2007, I'll see
>> you in Toronto!
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list