Sorry, I actually missed your use of transformer. I was thinking of
something even simpler:
<class name="mouseattachment" extends="node">
<method event="oninit">
this.parent.mouseisin = false;
this.moverdel = new LzDelegate( this, "onmouseover", parent,
"onmouseover" );
this.moutdel = new LzDelegate( this, "onmouseout", parent,
"onmouseout" );
</method>
<method name="onmouseover">
this.parent.mouseisin = true;
</method>
<method name="onmouseout">
this.parent.mouseisin = false;
</method>
</class>
(I guess I could just answer my own question by trying this code out.
I'll do that if I get time tonight.)
jim
On Dec 20, 2005, at 2:44 PM, Jim Grandy wrote:
On Dec 20, 2005, at 1:48 PM, Adam Wolff wrote:
Anyway on Dec 20, Jim Grandy wrote:
[snip]
I've seen code in various places in the LFC and components that
creates
event handlers with reference attributes to hook into events in a
parent
view. Granted it is manual, not automatic like states, but
couldn't this
technique be used to build attachment classes that simply
register for
events at initialization?
[snip]
So are you proposing a transformer class (not like an LFC
transformer)
which tends to be used as a singleton and which takes LzNode
instances and
tinkers with them? e.g.
<transformer name="trMouseView">
<method name="transform" args="v">
v.addAttribute( "mouseisin" , false );
v.bindEventHandler( "onmouseover" ,
this.setMouseIsInTrue );
...
</method>
<method name="setMouseIsInTrue">
this.setAttribute( "mouseisin" , true );
</method>
...
</transformer>
A
Yes. Wouldn't this work? How does this require namespaces, five bug
fixes, or a change to the inheritance hierarchy?
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev