vaadin / portlet

Portlet support for Vaadin Flow
https://vaadin.com
Other
2 stars 3 forks source link

Liferay edit mode: content not visible when adding same portlet multiple times on the page #212

Open mcollovati opened 2 years ago

mcollovati commented 2 years ago

When adding the same portlet twice on a Liferay Content Page in edit mode, the first instance has visible contents, but the second one is blank.

image

As a workaround a user can simply refresh the page, and all portlet instances are correctly rendered.

May be related to #211

To reproduce this bug :

Expected behavior: All portlet instances added to the page are rendered correctly Actual behavior: Only first portlet instance added to the page is visible

Versions: Vaadin Portlet version - 1.0.0.beta4 Flow version - 2.7.8 Liferay version - 7.4 Java version - 11

mcollovati commented 2 years ago

After a quick investigation seems like that when second instance is added to the page, _getClientStrategy is invoked before window.Vaadin.Flow.Portlets.initListenerRegistration, because the webcomponent is already registered and customElements.whenDefined(tag) is immediately resolved.