Automatic height issue with iViews in WPC
Symptom
When an URL iView is added in a WPC container the automatic height settings for it has no effect. iViews appear with scrollbars and are limited to the dimensions of their WPC container.
Reason and Prerequisites
Reason:
In order to realize this feature, the HTML document of the page needs access to the HTML document rendered by the iView. iViews that make use of iFrames to render content in an isolated manner need to take into account the following prerequisites to be able to comply with browsers’ security mechanisms that prevent from malicious usage of JavaScript with iFrames and alike:
The page and the iView should be in the same domain. (e.g. .yourdomain.com).The portal should be addressed using the fully qualified domain. (i.e. http://machine.tlvp.sap.corp/irj and not http://machine/irj).The portal and the iView should be accessed in the same HTTP scheme (e.g. http or https)
Those restrictions impose certain limitations to some iViews rendered in isolated mode:
KM Document iViews with URL isolation mode:When the document is not a HTML page, automatic height function is not supportedWhen the document is custom HTML page, automatic height is not supported by default. To enable the support, specific JavaScript code for domain relaxing must be inserted in the head section of the page HTML document. The required code should be similar to the one described in note 764773. The injection and execution of that JavaScript code will cause calculation of the height of the custom HTML page right after its rendering. The space arranged for it, will be the initial height of the page.
If above requirements are met and the height of a custom HTML page changes (for example with some dynamic HTML techniques), the new height will not be taken into account. To force recalculating of the height, some JavaScript code has to be executed in the HTML page similar to this:
var myIframe = getMyParentIframeObj();
parent.pageSupport._applyHeight( myIframe, 1 );
parent.pageSupport.adjustHeight( myIframe );
JavaScript function getMyParentIframeObj have to be defined in client code in this way:
function getMyParentIframeObj() {
var iframes =
parent.document.getElementsByTagName(”iframe”);
for( var i=0; i
var w = null;
if( o.contentWindow ) {
w = o.contentWindow;
} else if (
window.frames &&
window.frames[o.id] &&
window.frames[o.id].window ) {
w = window.frames[o.id];
}
if( w == window ) {
return o;
}
}
return null;
}
A page that meets these requirements is attached to the note. It can be used as reference for creating iViews or pages that fully support resizing.
URL iViewsWhen the URL target is a customer HTML page from the same portal or domain where the iView is used to compose a page, the requirements for the target page are the same as the requirements for target HTML page in KM Documents iView.When the URL target is a portal HTML page from the same portal or any NetWeaver portal in the same domain, Automatic height feature is supported, but only the initial height is taken into account.When the URL target is not a HTML page, automatic height feature is not supportedWhen the URL target is a HTML page out of the portal where the iView is used to compose a page, the automatic height feature is not supported due to a restriction introduced by browsers' security mechanisms.All other standard SAP iViews: The automatic height is supportedCustomer's iViews. The requirements and abilities for automatic height resizing are the same as KM Documents iView with customer#s iView page as a target.
The behavior of Automatic height function may be controlled by the properties #Minimum Automatic Height# and #Maximum Automatic Height#, so the customers can limit the range of area arranged.
Affected versions:
SAP NetWeaver 7.0 (formerly named 2004s) up to SP 17SAP NetWeaver 7.0 Enhancement Package 1 up to SP 3
Solution
A.) The issue is cleared in these deliveries:
Patch 4 for KMC WEB PAGE COMPOSER 7.00 SP 15Patch 3 for KMC WEB PAGE COMPOSER 7.00 SP 16Patch 2 for KMC WEB PAGE COMPOSER 7.00 SP 17SAP NetWeaver 7.0 SPS 18SAP NetWeaver 7.0 Enhancement package 1 SP4
See http://service.sap.com/sp-stacks -> SP Stack Schedule
for schedule details and updates.
B.)Possible workaround before the release of mentioned deliveries:
Creating a new WPC Web Form is the best workaround and the following How To guides can be used:
How to create custom Web Forms:
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2041eb17-6001-2b10-b08d-b95ce55fa9b7
or
http://help.sap.com/saphelp_nw70/helpdata/EN/45/fef93198f13830e10000000a11466f/frameset.htm
As example the attached xml and xsl files can be used when going through these steps.