lightbox: inside child components

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

lightbox: inside child components

EstebanLM
Hi all,
I'm having this problem:  I have component C inside compoent B inside
component A (C is child of B who is child of A)

Component C has a form, who has to make some validations and, if
something is wrong, show a popup with the error message.

Something like this:

accept
        [ self subasta addOferta: (SIOferta new owner: self session user;
valor: valor) ]
        on: Error
        do: [ :e| self lightbox: (WAFormDialog new addMessage: e messageText;
yourself) ].

Well, the problem is that it does not work, lightbox is not showed and
nothing happens (no error on squeak either)

Of course, If I do: self grandParent lightbox: blah, everithing works
fine (#grandParent does not exist, is just an example... I know is not
the correct design).
So, #lightbox: does not work in child components with two levels of
penetration.

My doubt is this: Should it work? if not... Shouldn't throw an exception?

Ah!, I'm using Seaside2.8a1-pmm.539 and Scriptaculous-lr.240, in Squeak
3.10 (7159)

Thanks,
Esteban


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

Re: lightbox: inside child components

Lukas Renggli
>  Of course, If I do: self grandParent lightbox: blah, everithing works fine
> (#grandParent does not exist, is just an example... I know is not the
> correct design).
>  So, #lightbox: does not work in child components with two levels of
> penetration.

SULightbox is an example on how one could implement a lightbox. Any
lightbox depends very much on the XHTML structure and the CSS of your
page. There is probably no way around building your own that works
with your setup.

Lukas

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

Re: lightbox: inside child components

squeakman
In reply to this post by EstebanLM
Esteban Lorenzano wrote:

> Of course, If I do: self grandParent lightbox: blah, everithing works
> fine (#grandParent does not exist, is just an example... I know is not
> the correct design).
> So, #lightbox: does not work in child components with two levels of
> penetration.
>

My understanding of your problem is that you have a containment
hierarchy of objects and you want some object deep in the hierarchy to
tell objects higher up that something of interest happened. And to do
this with loose coupling.

The approach that I took to solve this problem was to use Announcements.
  When I am building my containment hierarchy (A contains B who contains
C etc) I am careful to have A register for announcements from B.  B can
choose to propagate announcements originating from C up to A.

I am not sure if this is the standard way to do things or if it is
correct but it works.  The downside is that it takes quite a bit of
setting up - all those Announcements with their #when:do: messages.

What do others think? Is this an acceptable solution? Is there a better way?

HTH,
Frank

_______________________________________________
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: inside child components

Edward Stow
On Sat, Apr 19, 2008 at 11:34 PM, Squeaker <[hidden email]> wrote:

> Esteban Lorenzano wrote:
>
>
> > Of course, If I do: self grandParent lightbox: blah, everithing works fine
> (#grandParent does not exist, is just an example... I know is not the
> correct design).
> > So, #lightbox: does not work in child components with two levels of
> penetration.
> >
> >
>
>  My understanding of your problem is that you have a containment hierarchy
> of objects and you want some object deep in the hierarchy to tell objects
> higher up that something of interest happened. And to do this with loose
> coupling.
>
>  The approach that I took to solve this problem was to use Announcements.
> When I am building my containment hierarchy (A contains B who contains C
> etc) I am careful to have A register for announcements from B.  B can choose
> to propagate announcements originating from C up to A.
>
>  I am not sure if this is the standard way to do things or if it is correct
> but it works.  The downside is that it takes quite a bit of setting up - all
> those Announcements with their #when:do: messages.
>
>  What do others think? Is this an acceptable solution? Is there a better
> way?

I have exaclty the same problem -- nested components that need event
propogation.  In another thread running at the moment Keith Hodges
(Menu component - communicating with root component) has expressed
similiar issues.

I'm thinking would some sort of event / announcement  bubbling in
nested components (aka html dom) would be a good idea ?

--

Edward Stow
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside