留言板
LR7CEGA2 Issues rendering portlets
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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Liferay Legend 帖子: 14916 加入日期: 06-9-2 最近的帖子
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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子David 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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
Hi darren.
are you referring to portlets recently added to that page?
are you referring to portlets recently added to that page?
darren rose,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子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
Juan Gonzalez,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子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...
darren rose,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子Juan 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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子
actually, this resolved the issue for private pages and not public pages
darren rose,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子Juan 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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子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?
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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子Bruno 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
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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子Bruno 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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子
as I want to test the portlets outside of Liferay
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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子Bruno 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>
You are right. AUI().ready will fire even when the page is already loaded.
darren rose,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子Bruno 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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子
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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子Juan 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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子Juan 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
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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子
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
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,修改在7 年前。
RE: LR7CEGA2 Issues rendering portlets
Regular Member 帖子: 215 加入日期: 15-4-4 最近的帖子
sure, how do I deliver this to you?
regards
regards