Igalia/libreplan — pull request #2 by ogf (2012-12-11 15:39:04+00:00)
Title: Improve create/reload bindings situation

Now I track in a per request basis which components have already been asked to be reloaded. This avoided a spurious reload of getOrders when using the tab button. **This new strategy is optional and must be requested explicitly with an extra argument to reload bindings**.

For when entering from an entry point, I've solved the issue using dynamic scope, i.e., via a ThreadLocal. Thus we avoid to complicate ITab interface.

The strategy we've talked about, detecting if the binder is present, cannot be used because the binder is added after all the page is composed. When adding the tab it hasn't been composed yet.

An alternative would be to detect if the page is being composed for the first time, i.e., loaded from an URL versus a subsequent event. I didn't find an easy way. One option could be to install a listener as explained here. Another would be to pospone the creation of the bindings using Events#postEvent so that the binder added by zk is added at that time.