I wish to achieve birectional binding of UI and data using Request Factory Proxies, and for that part I need a way to listen to the changes in a EntityProxy or a ValueProxy. If they were ordinary models, I could have attached my view to the model’s change listener, but in request factory, the models or “proxies” are interfaces and I can’t figure out, how to let the view know when a “setter” method is called.
Is there a way I can do this, without wrapping the proxy and delegating the setters to proxy, while at the same time raise events ? I want the functionality to be “plugged in” directly into the proxy.
We have actually come up with a workaround. We tapped into the GWT generator code and added a
Listenerfield in the autobean proxy. After that we appended alistener.execute()in each of the generatedsettermethods. So now we can attachchange listenersto the proxy and listen to them.The only thing that worries me, is a
JSNIcall used to call a protected method and also tapping into the GWT generator code. How fine is this?