掲示板

Liferay IFrame portlet auto-resize issue

11年前 に Rhina Karr によって更新されました。

Liferay IFrame portlet auto-resize issue

Junior Member 投稿: 86 参加年月日: 10/11/02 最新の投稿
Hi Guys,

I am using Liferay 6.1. I have a requirement to embed a Liferay Iframe portlet in a page. The iframe portlet contains an application running on a different server on different machine.Now I am able to integrate the application, but the iframe doesn't resize based on the application's data, instead it added a scroll bar. I don't want a scroll bar in the iframe. If the data inside the iframe is large, the iframe should automatically resize in the page.
I found that if the application in the iframe is hosted on thesame server(where Liferay is running), then auto resize works. But if the application is on different server, how can we make the iframe resize automatically, instead of scrollbar.
Any solution???
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Liferay IFrame portlet auto-resize issue

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
It's suppose to have been fixed. Please create a new issue in the jira.
http://issues.liferay.com/browse/LPS-15818
11年前 に Rhina Karr によって更新されました。

RE: Liferay IFrame portlet auto-resize issue

Junior Member 投稿: 86 参加年月日: 10/11/02 最新の投稿
Hi Hitoshi,
Thanks for your reply.
I am testing it in IE8 browser. As per the LPS issue, it was working in Firefox, but not Chrome. But in my case, its not working in IE, if my external application, configured with Iframe is hosted in a different server. I'mworking with Liferay 6.1. Any solution from you is appreciated.

Thanks,
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Liferay IFrame portlet auto-resize issue

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
As I've written before, please create a new issue in Liferay jira to get it corrected because it's probably a bug.
thumbnail
10年前 に Victor Zorin によって更新されました。

RE: Liferay IFrame portlet auto-resize issue

Liferay Legend 投稿: 1228 参加年月日: 08/04/14 最新の投稿
We have hit similar issues related to the managing of height of iFrame portlet following to changes in content height.

IFrame portlet does not do it properly even for applications running on the same server, this includes Liferay Enterprise 6.1.20 environments.

A jsp hook was made to address this, at the moment it can be downloaded from this link:
http://www.myoffice24x7.com/documents/10162/37311/iframe-portlet-hook

We suspect that the issue comes from iframe attribute height being auto-populated from some default data (e.g. height='600'), who knows where it came from...
If content actual height goes over 600px, we can see that the style is being updated properly by auto-resize javascript, but in some browsers 'height' attribute takes precendence over style values.

This patch removes height attribute from the iframe tag.
9年前 に c s によって更新されました。

RE: Liferay IFrame portlet auto-resize issue

New Member 投稿: 8 参加年月日: 13/09/11 最新の投稿
I was having weird issues with the height of the iFrame as well and even the hook mentioned above, did not seem to work as expected. What worked for me is adding the following JavaScript to the page where the IFrame portlet is added. This works in IE, Chrome and Firefox.

$(window).load(function() {
$(window).resize();
});
$(document).ready(function() {
$(window).resize(function() {
fullHeight = $(window).height();
headerHeight = $("#banner").outerHeight();
footerHeight = $("#footer").outerHeight();

$("iframe").height((fullHeight-headerHeight-footerHeight-60)+"px");
});
});
9年前 に Sravan kumar によって更新されました。

RE: Liferay IFrame portlet auto-resize issue

New Member 投稿: 4 参加年月日: 14/01/14 最新の投稿
Hello CS,
How the issue is resolved, I did the below steps
1. Deployed IFrame hook(patch) to remove height style from IFrame.
2. Configured Height Normal to 900 and Height Maximized to 2000(maximum scroll). If we remove values for these 2 fields it leads to JS minifier issue. Also to verify the changes.
3. Added java script to page JS .

But still issue persists. Is any thing wrong above? Can you please shed a light

Thanks
Sravam
thumbnail
9年前 に Rob Zondag によって更新されました。

RE: Liferay IFrame portlet auto-resize issue

New Member 投稿: 8 参加年月日: 12/08/07 最新の投稿
Hi Victor,

We have the same issue here (the tickbox in the iFrame configuration "Resize Automatically" does not work).
Basically it will still use the values provided in the fields when un-ticked or the defaults (600px).
I have deployed the hook you made available on our test systems without success.

11:40:17,733 INFO [localhost-startStop-2][HotDeployImpl:178] Deploying iframe-portlet from queue
11:40:17,736 INFO [localhost-startStop-2][PluginPackageUtil:1033] Reading plugin package for iframe-portlet
11:40:17,830 INFO [localhost-startStop-2][HookHotDeployListener:550] Registering hook for iframe-portlet
11:40:17,835 INFO [localhost-startStop-2][HookHotDeployListener:690] Hook for iframe-portlet is available for use

I'll raise a LESA ticket for this as we're on 6.1.20 EE ... with support.

Cheers,

Rob
9年前 に Sravan kumar によって更新されました。

RE: Liferay IFrame portlet auto-resize issue

New Member 投稿: 4 参加年月日: 14/01/14 最新の投稿
Hi Rob,

Did you receive any updates on this issue. We are also facing the same issue here.

Thanks
Sravan
9年前 に Sravan kumar によって更新されました。

RE: Liferay IFrame portlet auto-resize issue

New Member 投稿: 4 参加年月日: 14/01/14 最新の投稿
Use the attached iframe hook to remove the dependency of height from portal configuration.

In Page configuration, use the JS code which is shared in this post to adjust the height

$(window).load(function() {
$(window).resize();
});
$(document).ready(function() {
$(window).resize(function() {
fullHeight = $(window).height();
headerHeight = $("#banner").outerHeight();
footerHeight = $("#footer").outerHeight();

$("iframe").height((fullHeight-headerHeight-footerHeight-60)+"px");
});
});
thumbnail
9年前 に RICARDO GARCIA HERNANZ によって更新されました。

RE: Liferay IFrame portlet auto-resize issue

New Member 投稿: 4 参加年月日: 14/10/01 最新の投稿
Hi,

I'm trying to use the hook you provided but I'm not sure where I have to include the javascript code. When you say Page configuration... Do you refer to the page refered in the iframe? If so, this page must be in the portal server or can be a page outside the server?

Thank you in advance.
8年前 に Paul Allain によって更新されました。

RE: Liferay IFrame portlet auto-resize issue

Junior Member 投稿: 77 参加年月日: 13/09/03 最新の投稿
RICARDO GARCIA HERNANZ:
Hi,

I'm trying to use the hook you provided but I'm not sure where I have to include the javascript code. When you say Page configuration... Do you refer to the page refered in the iframe? If so, this page must be in the portal server or can be a page outside the server?

Thank you in advance.


Hey Ricardo,

I'm trying to solve this problem by following all the explanations above without much success.

Have you managed to solve the iFrame height issue?

Thanks
Paul