pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: messages that ascend the containment hierarchy
Date Mon, 19 Jul 2010 13:03:19 GMT
It can't be done without changes to the platform, since "bubbling" requires invoking methods
on the parent (or having the parent respond to return values from methods called on the children,
which is how it is currently implemented).

Only user interface events are bubbling (or tunneling, in the case of container events). This
is by design. What is the use case for bubbling other types of events?

On Jul 19, 2010, at 8:54 AM, Michael Allman wrote:

> Actually this isn't what I'm looking for.  I'm looking for event bubbling. Nothing too
fancy.  Just bubble a message (event) up the component hierarchy allowing parent components
to listen for events from their children.
> I got something working on my end and I tried very, very hard to make as few changes
as possible to Pivot.  I tried getting it working with none, actually, but I ended up making
two changes to WTKXSerializer.  One is fairly innocuous and the other is fairly ugly.  I'm
not going to go into details until I've had a chance to find a better way.
> Cheers,
> Michael
> On Fri, 16 Jul 2010, Greg Brown wrote:
>> Ah, OK. If you are talking about intra-application message passing, Pivot actually
has a built-in API for that. See the subscribe(), unsubscribe(), and sendMessage() methods
of ApplicationContext (in Pivot 2.0, these live in org.apache.pivot.util.MessageBus).
>> On Jul 16, 2010, at 6:34 PM, Clint Gilbert wrote:
>>> Hash: SHA1
>>> I don't know your exact scenario, but I've had good luck in my pivot app
>>> using something like EventBus - basically an publish/subscribe system
>>> for events - for invoking code on sibling components.  There's even a
>>> Pivot-centric tutorial with lots and lots of examples:
>>> http://www.eventbus.org/confluence/pages/viewpage.action?pageId=819222
>>> Michael Allman wrote:
>>>> Is there a means in Pivot for a component to send a generic message to its
>>>> ancestors (aside from manually walking the hierarchy and calling methods
>>>> on each parent in turn)?  The prototypical example I'm thinking of here is
>>>> event bubbling.
>>>> Cheers,
>>>> Michael
>>> Version: GnuPG v1.4.9 (GNU/Linux)
>>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>> RYAAmQElWmB/6Agk4zIzqNEz4goqhB99
>>> =3v/w
>>> -----END PGP SIGNATURE-----

View raw message