|Action and updateTargets(): strange behaviour [message #674540]
||Fri, 27 May 2011 09:53
| Gianni Paglia
Registered: May 2011
I am hitting a strange behavior in the interaction between Action and DataBindingContext.|
In summary, I have a Text widget and a domain model which contains a nested object, and I have built a binding between the domain nested property and the Text widget.
I have 2 actions (which I will call internal actions) defined as anonymous subclasses of Action within the java compilation unit defining the ApplicationWIndow.
I have other 2 actions (which I will call external actions) defined in external java compilation units, with a 2 param constructor that allows me to pass in (on action creation) my domain object and the DataBindingContext object as defined inside the ApplicationWindow compilation unit.
All actions do the following:
= set the nested property inside the domain model to a string
= call updateTargets() on the DataBindingContext object
The behavior I see is the following:
= if I trigger one of the internal actions, I see the Text on the screen updated with the expected string
= if I trigger one of the external actions, I see no update on the screen
= after one of the external actions have been triggered at least once, also the internal actions will stop working (no update on the screen)
= I have tried passing the domain object and the DataBindingContext object to the external actions through a Singleton store instead of having a 2 param constructor but that doesn't change the behavior.
= if I use a simple property (not nested, i.e. a field of the domain model object) everything works properly then.
I hope somebody can explain this, maybe there is something wrong in my code or is this a bug?
I attach a zip with my java sources:
= ExpBinding is the main file, extending ApplicationWindow object
= ExpDomainModel is the domain model, containing a nested object of type ExpConfig
= ExpConfig is the nested object inside the domain model, the property I use is proxyHost (with setters and getters)
= ExpExternalAction and ExpExternalAction2 are the external actions (the first uses a 2 param contructor to receive the model and DataBindingContext, the second gets them through the ExpSingleton)
= ExpUtil just exposes a static doAction method performing the required action
= ExpSingleton is the singleton to store the domain model and the data binding context object (used by ExternalAction2)
(Size: 4.27KB, Downloaded 175 times)
Powered by FUDForum
. Page generated in 0.01761 seconds