Yes.  But you can only use that to call methods on `this` (i.e., the  
enclosing tag).  I think the question being asked was if there was a  
way to use the method property to call a method on the parent (which  
you cannot), and it also was passing different args (which you also  
can't do in the method property).  Really the only purpose of the  
`method` property is to connect a named method as the handler for an  
event, so that subclasses can override the handler action by  
overriding the named event.  (Since by default, handlers are  
cumulative -- they all are run in response to the event.)

If someone has a better way to describe this, I'd be interested,  
since it seems to still be a source of confusion, despite the new  
sytax (which was supposed to be so much clearer).

On 2006-09-22, at 15:16 EDT, Adam Wolff wrote:

> isn't there also this one:
>
>     <handler name="onfoo" method="bar"/>
>
> which calls bar() when onfoo is received.
>
> A
>
>
> On Sep 22, P T Withington wrote:
>
>> The correct syntax is:
>>
>> <handler name="onclick">
>>    parent.handleClick(someData, this);
>> </handler>
>>
>> That is, the body of a handler tag can be arbitrary Javascript.  (The
>> `method` attribute can only be used to name methods in the enclosing
>> view.)
>>
>> Conversely, if the parent wanted to be notified of events on the
>> child, you can say (in the parent):
>>
>> <handler name="onclick" reference="<name of child view>">
>>    ... this will run when you click on the child...
>> </handler>
>>
>> (The default value for `reference` is `this`, so the handler is for
>> you own events, but you can listen for events on other views by using
>> reference.)
>>
>> On 2006-09-22, at 10:47 EDT, Not Zippy wrote:
>>
>>> Hi
>>>
>>> Is it possible to make a shorthand method call to a parent  method
>>> from a handler ?
>>>
>>> <handler name="onclick" method="parent.handleClick(someData,this)"
>>> args="someData"/>
>>>
>>> Thx
>>>
>>> _______________________________________________
>>> Laszlo-user mailing list
>>> [email protected]
>>> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
>> :
>>
>>
>>
>> _______________________________________________
>> Laszlo-user mailing list
>> [email protected]
>> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
>>


_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to