In this article, I'm going to review some of the abilities and limitations of the URL-iView when used in combination with the Portal.
This e-blog post is aimed at developers and users who have a basic understanding and knowledge of Portal navigation.
URL-iView is somewhat different from other iViews: its sole purpose is performing a redirect to the specified URL.
At first glance – an easy operation, but due to the way in which the portal handles navigation and iView integration, some problems may arise. I will explain the technical details and the solutions which are provided in order to overcome them.
A guide for creating URL-iViews is in SAP note 1936087 - How to create a URL iView on NW EP?.
Firstly, we need to understand how the portal embeds iViews inside itself. In general, URL-isolated iViews are rendered in an iframe,
which is located in the content area of the portal. This is done by a mechanism which sets the "src" attribute of the iframe element to be the direct launch URL of the required iView.
When requesting the URL-iView via the direct launch URL, the server response includes the "redirect" header with the "target-url" of that URL-iView as a value. That header instructs the browser to perform a redirection to the "target-url".
The crucial point is that the browser redirects only the iframe which contains the request for the URL-iView and not the whole window.
Since the URL-iView must be URL-isolated, its content is rendered in an IFrame. This approach may cause the following problems:
For more information: SAP note 1636132 - JavaScript Errors When Calling a Custom or Third-Party Web Site in a Portal URL iVIew.
We have seen that rendering external content in an iframe might be problematic; therefore the only safe way (for most scenarios) to do it is by opening the desired "target-url" in a separate window.
The practical solution is to make the portal launch the direct launch URL of the URL-iView in a new window. In that way, the new window won't have any iframes. When getting the response from the server, it will instantly redirect itself to the "target-url" as if the target URL was typed by the user in the browser address bar.
There are two main methods you can use to navigate to a URL-iView (and to iViews in general). To Prevent issues when running
the URL-iView, the configuration you'll need will vary slightly, according to the method you choose:
To achieve the portal equivalent of window.open method, set the "Launch in New Window" property of an iView to "Display in Separate Window" (Navigation Mode = 1).
By doing so (and after applying all the relevant SAP notes), you configure the portal to launch the URL-iView in a new window whose target is the direct launch URL of the requested URL-iView.
The current SAP notes which explain how to troubleshoot this feature are:
1721745 - Navigation to URL iview in navigation mode 1 causes errors
2050956 - URL-iView fails when it is opened from "related links".
2061547 - URL-iView opened incorrectly from second level TLN
2055539 - Breadcrumb links do not open in a new window
2. Navigation using the Portal Navigation API:
For example, the following call is specified:
EPCM.doNavigate([direct-launch-URL], 1);
The direct-launch-URL can be constructed from the iView PCD location:
Let's say that the PCD location of your iView is "pcd:portal_content/some_role/myURLiView".
First, you replace each ":" with "!3a" and each "/" with "!2f". Now you get:
pcd!3aportal_content!2f some_role!2f myURLiView
You add the prefix:
/irj/servlet/prt/portal/prtroot/
So that the final result is the direct-launch-URL:
/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fsome_role!2fmyURLiView
By setting mode=1, you configure the portal to open a new window, and by setting the target to the direct launch URL, you ensure that the new window redirects properly as needed.
b. Navigation using the Navigation Tag Library:
If you are using the Navigation Tag Library to create links via JSP, then bear in mind the following:
When creating a link using the navNodeAnchor tag, set the navigationMethod to "byURL" and not "byEPCM", and, of
course, set the navigationMode to 1. This will ensure that the direct launch URL of the URL-iView will be used in the navigation to the new window.
So the code should look like this:
<nav:navNode navTarget="ROLES://portal_content/some_role/myURLiView">
<nav:navNodeAnchor navigationMethod="byURL" navigationMode="1"/>
</nav:navNode>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 |