On Sun, Mar 29, 2009 at 2:20 PM, Jan Rychter <[email protected]> wrote:
> 1. You seem to introduce a dom-id concept which could be different from
> :name initarg -- are they different concepts? If so, what is the purpose
> of :name?
I didn't introduce this, this was in my source tree that I cloned from
the dev tree. It's possible that it was removed from the dev branch at
some later point. From what I remember, name was left for backwards
compatibility with existing code (because it was used earlier), but it
just maps to dom-id.

> 3. Could you please describe the use case for this?
I found myself needing this quite a bit in different situations. I
don't remember all the use cases now, but I can give you the one I
just completed. I have a "quick feedback" link littered around my
application. When people click on it, they're presented with a dialog
where they can enter the feedback. Once they hit submit, I want to
tell them that their feedback has been received by posting a message
to a flash widget. Now, how do I find the flash widget? The feedback
link is rendered from different places that don't necessarily have the
reference to it. It's very useful to just lookup the flash widget by
its dom-id.

> 2. Do you need the lookups to be fast?
Personally, I do only a single look upon the quick-feedback action, so
I could do it by walking the tree. However, if people need to do many
lookups it becomes a O(kn) algorithm, where k is the number of lookups
and n is the number of widgets in the tree. This could get very
expensive very quickly. Doing a pass on the tree for shaking it down
before rendering is fine, but doing multiple passes if you do three or
four lookups? I don't know...

I probably would have used tree walking in this case, but my branch is
out of sync with the dev one, and adding this code was simply easier.

> 4. Did you consider the fact that your code will also find widgets which
> are not in the currently rendered document (DOM)?
Yep, but in this case it doesn't matter because I always show a header
widget that contains a flash I'm looking for.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to