oetiker wrote
> Hi Halcwb,
> 
> I guess you can use
> 
> http://demo.qooxdoo.org/current/apiviewer/#qx.event.message.Bus
> 
> to build something along these lines
> 
> cheers
> tobi

Exactly, without reading your post I came to the same solution. And it is
very elegant. I have now the following setup:

View.Button -> Click
View.clickHandler ->
    message.sender = view
    message.name = message
    message.data = additional data
    post message to eventbus

Controller 
  subscribes to eventbus with
  message = message and
  handler = messageHandler

So, now neither the view or the controller need any references to each other
== loose coupling == good!.
In the controller, when I receive the message I also want to check the
sender, using an interface, whether it is the right sender. So, then I am
guaranteed that I can use that sender.

What's even better, now I can use the same controller for different views,
as long as they implement the interface.

I know there is an assertInterface method. But is there also an
'hasInterface' that returns a boolean? 



--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Quickly-reference-widgets-in-browser-and-code-tp7586543p7586672.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to