Skip to content

Improve create/reload bindings situation#1

Closed
ogf wants to merge 4 commits intoLibrePlan:masterfrom
ogf:master
Closed

Improve create/reload bindings situation#1
ogf wants to merge 4 commits intoLibrePlan:masterfrom
ogf:master

Conversation

@ogf
Copy link
Copy Markdown
Contributor

@ogf ogf commented Dec 10, 2012

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.

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.

mrego and others added 4 commits December 10, 2012 20:18
Sometimes reloadBindings is called several times in the same request.
Now only the first call would force the reload and the others would be
ignored.

For example, when switching to Projects List reloadBindings is called
after the tab being created and another time when calling
org.libreplan.web.orders.OrderCRUDController.goToList(). Now the
second call is ignored.
A mechanism for ignoring in a scope the calls to createBindings has
been added. When accessing from the entry point the page is been
created and the AnnotatedDataBinder created automatically will track
the created tab. So in this case we must ignore createBindings calls.
When entering in the details of a order or an order element withing
from an entry point, the bindings must not be created.
@ogf
Copy link
Copy Markdown
Contributor Author

ogf commented Dec 10, 2012

I didn't test a98bb2a but I think entering the order details or an order element details is subject to the same problem as the project list and to the same solution.

@mrego
Copy link
Copy Markdown
Contributor

mrego commented Dec 11, 2012

I've tested your patches however they break the project creation pop-up. And maybe they also break other windows.

It seems a bit dangerous only reload bindings once, as maybe in some windows it's really needed to reload them again after some changes. But, maybe I'm just wrong.

Anyway, the patches cannot be applied at this moment.

Thanks.

@ogf
Copy link
Copy Markdown
Contributor Author

ogf commented Dec 11, 2012

I'll take a look at that issue.

@ogf ogf closed this Dec 11, 2012
This was referenced Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants