On Thu, Jan 6, 2011 at 11:21 PM, Aaron Newton <[email protected]> wrote:

> There's no real difference between global filters and instance filters. The
> instance is just checked for a match first, allowing you to create filters
> that aren't universal. There's absolutely no reason that a filter should be
> able to invoke Behavior's apply method.


I'm not sure I was understood:
1. A filter is loaded.
2. when loaded, it might fetch and create more elements.
3. these elements might need a behavior to be applied to them

now, the first solution is to hack request to run Behavior.apply on it's
elements. This IMO isn't good for a few reasons, one of which is if some of
my widgets use an extension of Behavior, or if the filter's behavior have
some local filters applied to it (assuming the request is using it's own
behavior instance).

a 2nd option is an evented behavior, which will run apply on every node
change. We've already found the problems with this one

the 3rd alternative is to allow the filter to somehow notify (maybe by
event) the parent behavior that new content was loaded, so it could be
parsed.

If I understood the current implementation correctly, then there isn't a
built in solution right now.

Anyway, I can easily think of at least 2 viable solutions for this
(onElementAdded event or supplying the reslevent method through the API),
and I know since it's a Class there's nothing easier than simply extending
the Class, but it was just a thought of an improvement.

-- 
Arieh Glazer
אריה גלזר
052-5348-561
http://www.arieh.co.il
http://www.link-wd.co.il

Reply via email to