-
Notifications
You must be signed in to change notification settings - Fork 3
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
Setting a render state with Portlet Hub doesn't work with Liferay #214
Comments
Liferay implementation of Portlet Hub API doesn't do anything when When the service-side code is running @Override
public void onPortletViewContextInit(PortletViewContext context) {
context.setWindowState(WindowState.MAXIMIZED);
} it then triggers If I open the browser console and execute: newstate = window.portlet.data.pageRenderState.portlets["_render_WAR_liferaytestsgeneric_INSTANCE_xfIl2IrfY46A_"].state
newstate.portletMode = 'edit'
window.portlet.data.pageRenderState.portlets["_render_WAR_liferaytestsgeneric_INSTANCE_xfIl2IrfY46A_"].state = newstate nothing happens. So either something isn't set up in |
Issue created in the Liferay's Issue tracker https://issues.liferay.com/browse/LPS-150560. Further development is blocked until we get more information from Liferay experts. |
Here is a feedback from Liferay (5.05.2022): We debugged the case further, mainly the JS files in the browser console, and our current observation is that when executing the state change either by clicking on the "Maximize/Normalize" buttons or the "To view mode/To edit mode" buttons, the code execution enters a poller method in Vaadin's PortletMethod.js file (around line 19), which seem to distrupt the execution. Therefore the code never finishes the setRenderState method in Liferay's PortletInit.es.js. More specifially, in the setRenderState the validateState(state, portletData); line is never reached:
Based on this observation, we currently suspect that the root cause might lay in Vaadin's code. As debugging the Vaadin code further falls out of Support's scope, we would like to kindly ask you to debug the case further on your side. If you still suspect that the problem is on our side, we kindly ask you to explain your findings in details. Many Thanks, |
The investigation was fulfilled on the impact of "poller" function on the state validation method. Answer sent to Liferay expert:
|
PortletViewContext::setWindowState
andPortletViewContext::setPortletMode
do not work with LIferay.When the Hub API is called
hub.setRenderState(state);
nothing happens and no exception or console errors are shown.vaadin-portlet-static
into LIferay container.Expected and actual behavior
Expected: portlet reacts to the state change and it's visual representation should change according to a new state.
Actual: nothing happens. Portlet only reacts if you change the
p_p_state
andp_p_mode
query parameters manually.Versions:
The text was updated successfully, but these errors were encountered: