Actually, the method name is defined by the attribute name: 
ButtonPressListener.buttonPressed. ButtonPressListener is the interface, and 
buttonPressed() is the handler method. The value of the attribute is the script 
that is executed when the buttonPressed() method is called. You can actually 
put any valid script code in there, but it is generally good to keep it to a 
minimum for readability.

On Dec 8, 2010, at 8:44 AM, Luiz Gustavo wrote:

> Hi Greg,
> 
> I undestood! methods used to register a listener can have any name... that's 
> it!
> 
> <PushButton buttonData="Click Me!" 
> ButtonPressListener.buttonPressed="onButtonPress1(); onButtonPress2()"/>
>  
> It answers my question. =)
> 
> Thanks!
> 
> 
> 2010/12/8 Greg Brown <[email protected]>
> > But I thought about the case of multiple common listeners, as I said. Do 
> > you think this could be an enhancement for future releases, or it's not 
> > worthy?
> 
> I don't think it is a common enough use case to justify extending BXML syntax 
> to support it. It is fairly easy to create a listener instance in Java (or 
> Scala, or even JavaScript) and attach it using getFooListeners().add(). 
> Besides, a listener is nothing more than a method - you could do something 
> like this if you really needed multiple "listeners:
> 
> <PushButton buttonData="Click Me!" 
> ButtonPressListener.buttonPressed="onButtonPress1(); onButtonPress2()"/>
> 
> G
> 
> 
> 
> 
> -- 
> Luiz Gustavo S. de Souza
> 
> http://luizgustavoss.wordpress.com
> http://luizgustavoss.blogspot.com
> http://twitter.com/lugustso

Reply via email to