2 Replies Latest reply on Aug 30, 2011 11:04 PM by Barno7

    Difference between object and object proxy (Mobile)

    Barno7 Level 1

      what are the differences between object and objecy proxy?

      If I pass the value between the view, via object, I get this warning:
      warning: unable to bind to property 'myValue' on class 'Object' (class is not anIEventDispatcher

        • 1. Re: Difference between object and object proxy (Mobile)
          UbuntuPenguin Level 4

          Are you asking about the warning or the object/object proxy.  Your title and warning text don't match.  Anyways, the error is coming from the fact that the class Object is not an event dispatcher, so any changes made on its properties will not be heard.  When something extends Eventdispatcher, it allows views and other objects to add listeners to various events and receive those events when they are dispatched , hence the term "EventDispatcher".  When something doesn't extend Eventdispatcher, it can't dispatch events, meaning those same views and objects can't listen to any changes made on the object.

           

          Now let's say you have an object that you can't have extend EventDispatcher for whatever reason, and you still want views to reflect updates to it, what do you do.  That is where the ObjectProxy class comes in, it implements IPropertyChangeNotifier which extends IEventdispatcher meaning that it can dispatch events and it can be listened to for said events.  So basically , you stuff your original non-Eventdispatcher class into an ObjectProxy and any interactions performed on the Object through the ObjectProxy wrapper will be heard by listeners.

          • 2. Re: Difference between object and object proxy (Mobile)
            Barno7 Level 1

            thanks for the explanation.
            I understand that I have explained the difference, and let you another question
            if I want to pass parameters, it is right to use object? from view to view