Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mcollovati opened this issue Mar 14, 2022 · 1 comment

Comments

@mcollovati
Copy link
Contributor

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 :

  • PR fix: Ensure necessary scripts are loaded into page #210 needs to be merged
  • Clone adressbook-portlet example, update liferay-portlet.xml to set /liferay-portlet-app/portlet/instanceableto true in addressbook-form module (to make it possible to put multiple portlet instances on the same page) and deploy it to the Liferay by copying in to {liferay_home}/deploy folder.
  • Open localhost:8080 and login into Liferay
  • Click on the "Edit" icon to start edit the page
  • Open "Fragments and Widgets" panel on the right side of the page, go to "Widget" tab
  • Find "Vaadin Sample" category on the bottom and then "ContactForm" element
  • Drag and drop the widget to the page.
  • Drag and drop the widget to the page one more time
  • Check that the second portlet/widget is blank

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 mcollovati added bug Something isn't working Liferay labels Mar 14, 2022
@mcollovati
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🔖 Normal Priority (P2)
Development

No branches or pull requests

2 participants