-
Bug
-
Resolution: Not an issue
-
Major
-
None
-
5.4.13, 5.5.5
-
None
I tried to implement for this support ticket SUPPORT-7792 following:
In the view SearchContentToolViewImpl using a ShortcutListener instead of a Property.ValueChangeListener.
The goal is, that only on KeyCode.ENTER a search is triggered, but not when leaving the field.
This lead to a very strange behavior:
I added a couple of patches. The patch 'SearchContentToolViewImpl-v1.patch' should work properly, but:
It works perfect with one app. But if you start a second app, operates on the view and presenter objects of the first app. Therefore also operates on the TextField and ShortcutListener from the first app!
But the target object (TextField, ShortcutListener.handleAction(Object, Object) ) is always the right TextField of the correct app.
Reproduce with any of the patches:
- Starting App A
- Do a search -> works
- Starting App B
- Do a search -> Operates on the SearchContentToolPresenter and SearchContentToolView of App A!! -> See in the logs (or debugger)
- Close App A and App B works perfect and operates on the objects as expected.
I created 5 patches so you can look at it easily:
SearchContentToolViewImpl-v1.patch: The code that should work
SearchContentToolViewImpl-v2.patch: Not as a private variable
SearchContentToolViewImpl-v3.patch: Returning the targetTextField and not the searchField (priv member) to the presenter. I expected that this works.
But they operates crossways -> App A gets parameter of App B, and App B gets parameter of App A! (see in location fragment)
SearchContentToolViewImpl-v4.patch: searchField not final and overridden with targetField -> same behaviour as V3
more-debugging.patch: Some more logging and passing of objects to proof that it operates actually within the wrong app.
I also ran to code agains 5.4.13, same behavior (suspected Guice changes of possible cause)