vaadin / multiplatform-runtime

4 stars 1 forks source link

Please add support for retrieving LegacyWrapper instance for a wrapped Component #64

Open mvysny opened 4 years ago

mvysny commented 4 years ago

Sometimes e.g. a security framework may require one to traverse the component tree, collect all security annotations and evaluate them.

However, with mixed V8-V14 code, it's not possible to cross the boundary to the containing V14 LegacyWrapper from a Vaadin8 Component: the getParent() will eventually lead us to MprUIContent, then to MprUI which has null parent.

It would be great to have a possibility to get the owning LegacyWrapper from a V8 Component.

mvysny commented 4 years ago

Workaround is to find all LegacyWrappers attached to V14 UI by iterating UI's descendants, and find LegacyWrapper with getLegacyComponent() pointing to the component in question. Optimization: only a component with AbstractMprUIContent as its parent is wrapped in a LegacyWrapper.