Fórum
LR7CEGA2 Issues rendering portlets
darren rose, modificado 7 Anos atrás.
LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens Recentes
Hi,
Custom portlets only show correctly after a customer has refreshed the page, they appear blank initially after login.
regards
Custom portlets only show correctly after a customer has refreshed the page, they appear blank initially after login.
regards
David H Nebinger, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
That can be normal depending upon your implementation. For example, if the page is already rendered but your portlet needs to inject header or footer javascript, well it can't quite do that since header and footer have already been rendered.
This shouldn't be a problem in general unless if you're worried that users are seeing this as an issue updating their private pages.
This shouldn't be a problem in general unless if you're worried that users are seeing this as an issue updating their private pages.
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens RecentesDavid H Nebinger:
That can be normal depending upon your implementation. For example, if the page is already rendered but your portlet needs to inject header or footer javascript, well it can't quite do that since header and footer have already been rendered.
This shouldn't be a problem in general unless if you're worried that users are seeing this as an issue updating their private pages.
these are portlets migrated from LR6.2CEGA6
and, as I said,refreshing the page, results in the portlets showing correctly.
Juan Gonzalez, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentes
Hi darren.
are you referring to portlets recently added to that page?
are you referring to portlets recently added to that page?
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens RecentesJuan Gonzalez:
Hi darren.
are you referring to portlets recently added to that page?
Hi,
I added portlets to a page. and now login as a user, the portlets don't show correctly until I refresh the page.
The portlet using javascript to load json from rest services as soon as the portlet is shown.
regards
Juan Gonzalez, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentesdarren rose:
Juan Gonzalez:Hi darren.
are you referring to portlets recently added to that page?
Hi,
I added portlets to a page. and now login as a user, the portlets don't show correctly until I refresh the page.
The portlet using javascript to load json from rest services as soon as the portlet is shown.
regards
Hi darren. With SPA, now some links are "cached" (those using RENDER_PHASE with no p_p_id), so whenever navigating there, that is being cached and next time doing it won't be refreshed by default. Fortunately this can be configured after https://issues.liferay.com/browse/LPS-65221 by some available options.
In order to change this, please read "Setting SPA Cache Configuration Options" from this page: https://dev.liferay.com/discover/portal/-/knowledge_base/7-0/system-settings
Hope it helps...
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens RecentesJuan Gonzalez:
darren rose:Juan Gonzalez:Hi darren.
are you referring to portlets recently added to that page?
Hi,
I added portlets to a page. and now login as a user, the portlets don't show correctly until I refresh the page.
The portlet using javascript to load json from rest services as soon as the portlet is shown.
regards
Hi darren. With SPA, now some links are "cached" (those using RENDER_PHASE with no p_p_id), so whenever navigating there, that is being cached and next time doing it won't be refreshed by default. Fortunately this can be configured after https://issues.liferay.com/browse/LPS-65221 by some available options.
In order to change this, please read "Setting SPA Cache Configuration Options" from this page: https://dev.liferay.com/discover/portal/-/knowledge_base/7-0/system-settings
Hope it helps...
Yes, that resolved the issue, thanks
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens Recentes
actually, this resolved the issue for private pages and not public pages
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens RecentesJuan Gonzalez:
darren rose:Juan Gonzalez:Hi darren.
are you referring to portlets recently added to that page?
Hi,
I added portlets to a page. and now login as a user, the portlets don't show correctly until I refresh the page.
The portlet using javascript to load json from rest services as soon as the portlet is shown.
regards
Hi darren. With SPA, now some links are "cached" (those using RENDER_PHASE with no p_p_id), so whenever navigating there, that is being cached and next time doing it won't be refreshed by default. Fortunately this can be configured after https://issues.liferay.com/browse/LPS-65221 by some available options.
In order to change this, please read "Setting SPA Cache Configuration Options" from this page: https://dev.liferay.com/discover/portal/-/knowledge_base/7-0/system-settings
Hope it helps...
Oddly, older portlets that I need to migrate to LR7, developed using GWT, still do not work, whether refreshing or setting the cache to 0.
Juan Gonzalez, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentesdarren rose:
Oddly, older portlets that I need to migrate to LR7, developed using GWT, still do not work, whether refreshing or setting the cache to 0.
Hmmm don't know right now compatibility between Senna/SPA and GWT. Did you see any javascript error?
Bruno Basto, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
New Member Postagens: 18 Data de Entrada: 13/05/10 Postagens Recentes
Hello, Darren!
Do your portlets rely on window.onLoad events or similar? With SPA, one thing to keep in mind is that this event will only be fired once. After that, for every SPA navigation window.onLoad won't fire because the page is already loaded. If you are using JSP, we recommend developers to use the aui:script taglib. It'll concatenate, minify and print your JavaScript right before closing the <body> tag so that whatever DOM element you need to use will already be available.
Do your portlets rely on window.onLoad events or similar? With SPA, one thing to keep in mind is that this event will only be fired once. After that, for every SPA navigation window.onLoad won't fire because the page is already loaded. If you are using JSP, we recommend developers to use the aui:script taglib. It'll concatenate, minify and print your JavaScript right before closing the <body> tag so that whatever DOM element you need to use will already be available.
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens RecentesBruno Basto:
Hello, Darren!
Do your portlets rely on window.onLoad events or similar? With SPA, one thing to keep in mind is that this event will only be fired once. After that, for every SPA navigation window.onLoad won't fire because the page is already loaded. If you are using JSP, we recommend developers to use the aui:script taglib. It'll concatenate, minify and print your JavaScript right before closing the <body> tag so that whatever DOM element you need to use will already be available.
Hi,
yes, they do,
thanks
Bruno Basto, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
New Member Postagens: 18 Data de Entrada: 13/05/10 Postagens Recentes
Oh, ok. Can you try removing the window.onLoad?
You could do something like:
From
To:
Let me know how that works out.
You could do something like:
From
<script type="text/javascript">
window.onLoad = function {
// init my portlet
}
</script>
To:
<aui:script>
// init my portlet
</aui:script>
Let me know how that works out.
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens RecentesBruno Basto:
Oh, ok. Can you try removing the window.onLoad?
You could do something like:
From<script type="text/javascript"> window.onLoad = function { // init my portlet } </script>
To:<aui:script> // init my portlet </aui:script>
Let me know how that works out.
Currently, I am doing this:
<script type="application/javascript">
(function() {
if (typeof(AUI) !== 'undefined') {
AUI().ready(function() {
startApp();
});
} else {
document.addEventListener("DOMContentLoaded", function(event) {
startApp();
});
}
})();
</script>
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens Recentes
as I want to test the portlets outside of Liferay
Bruno Basto, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
New Member Postagens: 18 Data de Entrada: 13/05/10 Postagens Recentes
Ok, so I think you could do something like:
if (document.readyState == "complete" || document.readyState == "loaded") {
// start app right away
startApp();
}
else {
// listen for load event to start app
document.addEventListener("DOMContentLoaded", startApp);
}
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens RecentesBruno Basto:
Ok, so I think you could do something like:if (document.readyState == "complete" || document.readyState == "loaded") { // start app right away startApp(); } else { // listen for load event to start app document.addEventListener("DOMContentLoaded", startApp); }
thanks, isn't this an equivalent, which always works on LR6.2CE?
<script type="application/javascript">
(function() {
if (typeof(AUI) !== 'undefined') {
AUI().ready(function() {
startApp();
});
} else {
document.addEventListener("DOMContentLoaded", function(event) {
startApp();
});
}
})();
</script>
Bruno Basto, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
New Member Postagens: 18 Data de Entrada: 13/05/10 Postagens Recentes
You are right. AUI().ready will fire even when the page is already loaded.
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens RecentesBruno Basto:
You are right. AUI().ready will fire even when the page is already loaded.
which works fine in LR6, but not LR7, hence, the purpose of this intial post
Juan Gonzalez, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentes
Hi darren.
You said it was working fine in private pages but not public ones.
This makes me think you need to use some AUI module in your AUI method. Which AUI features you use in your startApp function?
You said it was working fine in private pages but not public ones.
This makes me think you need to use some AUI module in your AUI method. Which AUI features you use in your startApp function?
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens Recentes
Hi Juan,
I don't use any aui features, I just want to know if the page has loaded, so that the javascript may then execute.
thanks
I don't use any aui features, I just want to know if the page has loaded, so that the javascript may then execute.
thanks
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens RecentesJuan Gonzalez:
Hi darren.
You said it was working fine in private pages but not public ones.
This makes me think you need to use some AUI module in your AUI method. Which AUI features you use in your startApp function?
I only use the AUI.ready() function
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens RecentesJuan Gonzalez:
darren rose:
Oddly, older portlets that I need to migrate to LR7, developed using GWT, still do not work, whether refreshing or setting the cache to 0.
Hmmm don't know right now compatibility between Senna/SPA and GWT. Did you see any javascript error?
unfortunately, I do not see any javascript errors
Bruno Basto, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
New Member Postagens: 18 Data de Entrada: 13/05/10 Postagens Recentes
Hello Darren,
AUI().ready behavior hasn't changed. Can you confirm that, after navigation, the browser executes those lines of code?
<script type="application/javascript">
console.log('executed');
(function() {
if (typeof(AUI) !== 'undefined') {
AUI().ready(function() {
startApp();
});
} else {
document.addEventListener("DOMContentLoaded", function(event) {
startApp();
});
}
})();
</script>
About the GWT issue: How is the generated javascript from GWT included on the page?
AUI().ready behavior hasn't changed. Can you confirm that, after navigation, the browser executes those lines of code?
<script type="application/javascript">
console.log('executed');
(function() {
if (typeof(AUI) !== 'undefined') {
AUI().ready(function() {
startApp();
});
} else {
document.addEventListener("DOMContentLoaded", function(event) {
startApp();
});
}
})();
</script>
About the GWT issue: How is the generated javascript from GWT included on the page?
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens Recentes
will do.
Actually, the GWT portlet is now working, it just has the same issue as the normal portlets, both render on private pages, but only on public pages if the page is refreshed
Actually, the GWT portlet is now working, it just has the same issue as the normal portlets, both render on private pages, but only on public pages if the page is refreshed
Bruno Basto, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
New Member Postagens: 18 Data de Entrada: 13/05/10 Postagens Recentes
This public page issues is very odd. Is it possible to provide us with a WAR file of an example portlet so that we can try to reproduce it here?
darren rose, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
Regular Member Postagens: 215 Data de Entrada: 04/04/15 Postagens Recentes
sure, how do I deliver this to you?
regards
regards
Bruno Basto, modificado 7 Anos atrás.
RE: LR7CEGA2 Issues rendering portlets
New Member Postagens: 18 Data de Entrada: 13/05/10 Postagens Recentes
Can you provide a link to dropbox or google drive? If not, you can create a ticket under issues.liferay.com and attach it to it