Community
Participate
Working Groups
Build Identifier: 20110301-1815 I have created an ApplicationWindow subclass named TestBinding with a Text widget called proxyHost I have created a public method in TestBinding that calls updateTargets() on the DataBindingContext (so that I can trigget the updateTargets() from an external action) I have a domain object pojo (class DomainModel) containing another pojo (class Config). I have set up a binding between the Text widget (proxyHost) and the nested property "config.proxyHost" within the domainModel pojo (I have the proper setters and getters, I can access the property as domainObject.getConfig().getProxyHost() I have configured 3 actions, 2 internals and 1 external. The external action is a subclass of Action, with a 2 parameter constructor accepting the TestBinding object and the DomainModel object so I can access, from the external action, the DomainObject object and the TestBinding object. In the actions run() method I do the following: - set the nested property to a specific string (domainObject.getConfig().setProxyHost("XXX")) - call the updateTargets() on the DataBindingContext (in the external action I do this calling the exposed updateTargets() method on the TestBinding object) The behaviour is the following: - the internal actions behave correctly - if I trigger the external action from the menu, the target is not updated (i.e. the proxyHost Text is not updated on the screen) - once I have triggered the external action once, the internal actions will also stop working and the target (the proxyHost Text) is no longer updated This behaviour is present with both the following binding statements: IObservableValue domainModelgetConfigProxyHostObserveValue = PojoObservables.observeValue(domainModel, "config.proxyHost"); IObservableValue domainModelgetConfigProxyHostObserveValue = PojoObservables.observeValue(domainModel.getConfig(), "proxyHost"); I attach a rar with the java sources I have used. Regards Gianni Reproducible: Always
Created attachment 196599 [details] java sources I used to reproduce the behaviour
I have understood this is not at all a bug. The behaviour depends on the fact that the createContents method (which initializes the DataBindingContext) runs after createActions() and therefor the external action is initialized with an invalid DataBindingContext object. I therefore close the bug. G