cancel
Showing results for 
Search instead for 
Did you mean: 

How to set static name and id for IFRAME html generated

Former Member
0 Kudos

Hi,

The name and the id of the Iframe is generated dynamically as shown in this example (final html generated):

<IFRAME frameBorder=0 id="ivuFrm_page0ivu3" name="pb_837905732" title="Direccion Comunicaciones Integradas Home" src="home_direccion_comunicaciones_integradas.html" style="WIDTH:100%;HEIGHT:455px;" fixedHeight="455px" ></IFRAME>

However, we need to link to this iframe using the "target" property which has not been possible because we need static iframe name.

Anny suggestions?

THANKS.

Accepted Solutions (0)

Answers (2)

Answers (2)

safter_maskan
Explorer
0 Kudos

Hi,

first of all i think it is possible, you just need create a layout with nwds, Thats possible in a .Par project you need this referance in portalapp.xml ;

<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>

after creating this you need create a jsp file for coding, it is possible with writing this in portalappxml ;

<property name="com.sap.portal.reserved.layout.TemplateFile" value="example.jsp"/>

in this jsp page write this code:

<%@ taglib uri="prt:taglib:com.sap.portal.reserved.layout.TagLibLayout" prefix="lyt" %>

<%@ page import = "com.sapportals.portal.prt.pom.IPortalNode" %>

<%@ page import = "com.sapportals.portal.prt.connection.IPortalResponse" %>

<%@ page import = "com.sapportals.portal.prt.connection.PortalHtmlResponse" %>

<%@ page import = "com.sapportals.portal.prt.util.html.HtmlDocument" %>

<%@ page import = "com.sapportals.portal.prt.util.html.HtmlMeta" %>

<%@ page import = "com.sapportals.portal.prt.util.html.HtmlTitle" %>

<%@ page import = "com.sapportals.portal.prt.util.html.HtmlDocType" %>

<%

IPortalNode portalNode = componentRequest.getNode().getPortalNode();

IPortalResponse portalResponse =

(IPortalResponse) portalNode.getValue(

IPortalResponse.class.getName());

HtmlDocument htmlDocument = null;

if (portalResponse instanceof PortalHtmlResponse) {

PortalHtmlResponse htmlResponse =

(PortalHtmlResponse) portalResponse;

htmlDocument = htmlResponse.getHtmlDocument();

}

com.sapportals.portal.prt.util.html.Html htm = htmlDocument.getHtml();

com.sapportals.portal.prt.util.html.HtmlBody body = htmlDocument.getBody();

body.getElement("iframe name");

You can get elements and change, remove or add new elements to framework

%>

<table width ="100%" >

<lyt:template>

<tr>

<td width ="25%" align="center" valign="top">

<lyt:container id="column1" />

</td>

<td width ="50%" align="center" valign="top">

<lyt:container id="column2" />

</td>

<td>

<td width ="25%" align="center" valign="top">

<lyt:container id="column3" />

</td>

</tr>

</lyt:template>

</table>

After Deploying the layout, create a page with this layout and inculude the this empty page to framework.

İts should be work.

Best regards.

i827647
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rafael, I think that you get this peace of code by show source code in the browser. This information was dynamic generate by Application Server SAP, and probably was developed in Web Dynpro or other technologie developed by SAP and you donu2019t have any way to fix this id.

Regards,

Edson Thomaz