P T Withington wrote:
You can do this in on operation:
new lz.Delegate(this, 'something', that, 'eventname');
you'll want to hang on to a reference to the new delegate, so you can
unregister it in your destroy method, otherwise it causes a leak.
We hope to fix this some day:
http://jira.openlaszlo.org/jira/browse/LPP-225
Also, we have some ideas about how to dynamically add handlers, so
that you don't have to understand the delegate mechanism to do what
you want. (Hm. can't find the Jira for tha just now...)
On 2009-10-04, at 16:58, James Robey wrote:
Poor form, sorry, but i answered my own question. I didn't need to
do make another attribute. i found another way around the problem
using these two lines which are a common pattern:
var something_method = new lz.Delegate(this, "something");
something_method.register(parent.after, "onmyevent");
That worked just fine for my needs once i realized it was all i
needed. Thanks for reading it!
.james.
I wasn't very descriptive, sorry. Ideally i'd like to say
new lz.attribute(parent, {name:"somestate", type:"string", value:someval});
and have that work from that point on just as a normal attribute would.
Am i missing a pattern that lets me do this clearly? It would be like
annotations, i guess. and thanks for your response.