cancel
Showing results for 
Search instead for 
Did you mean: 

EPCM and JspDynPage problem

Former Member
0 Kudos

Hallo Friends,

I have a Portal page with 2 IViews.One iview is of Webdynpro application and other one is Portal application developed using JspDynPage.

I have 2 Jsp's(page1.jsp and Page2.jsp) inside the portal application.

page1.jsp is having only one image and has subscriped to 2 events which would be coming from WebDynpro iview.

When the event occurs in page1.JavaScript is submitting the form to the serverside.

var form = document.all(htmlb_formid);

form.submit();

Now serverside java program builds a url for one of the iframe src property and set it to the Bean variable and calls Page2.jsp

this.setJspName("Page2.jsp");

Page2.jsp has 2 iFrames and from the Bean variable i set the URL(External such as Yahoo/google) to SRC property of the Iframe .

I have also subscriped 2 EPCM events in this Page2.jsp.

So far so good.

When an event occurs i submit the form same way as

var form = document.all(htmlb_formid);

form.submit();

Now , in the Serverside new url is build and bean variable is changed but the Jsp page is same page(Page2.jsp).I can see in the debug this statement is executed

this.setJspName("Page2.jsp");

but in the portal page, this iview is automatically shrinked and there is no UI element visible.

I have tried onreload method for Iframe but nothing helps?.I have not seen any errors also ?

What could be wrong here ??.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Could you provide some code regarding your event handling on the dynpage and how the form is setup in Page2.jsp

Dagfinn

Former Member
0 Kudos

Hi Dagfinn,

Here is the code in java class1

public void doProcessAfterInput() throws PageException {

InputField reportfld = (InputField) getComponentByName("pernr");

String evtString = reportfld.getValue().toString();

if(evtString.equals(null)){

state = INITIAL_STATE;

}else{

String action,entity,keyadm,strnaam,labelnaam,baseUrl,restUrl;

String []myString =evtString.split("#");

action = myString[0];

myBean.setUrl("http://www.sap.com");

state = WELCOME_STATE;

}

}

public void doProcessBeforeOutput() throws PageException {

switch (state) {

case INITIAL_STATE :

this.setJspName("Page1.jsp");

break;

case WELCOME_STATE :

this.setJspName("Page2.jsp");

break;

default:

this.setJspName("Page2.jsp");

break;

}

}

Here is Page2.jsp

<%@ taglib uri= "tagLib" prefix="hbj" %>

<%@ page import = "com.sapportals.htmlb.enum.EventTrigger" %>

<%@ page import = "com.sapportals.htmlb.event.Event"%>

<jsp:useBean

id="myBean"

scope="application"

class="com.getronics.newurl.bean.myBeanName"

/>

<SCRIPT

language="JavaScript">

var gotValue=false;

var iframeResized=false;

var myUrl="";

var defUrl="http://www.sap.com";

function resize_iframe(){

myUrl = "<%=myBean.getUrl()%> ";

var myId = parent.pageSupport.getIvuId(self);

var myWindow = parent.pageSupport.getIvuFrameWindow(myId);

alert(myWindow.location.href);

if(gotValue==false)

{

if(myUrl!="" && myUrl!=undefined)

document.getElementById("Nedbrowser").src =myUrl;

else

document.getElementById("Nedbrowser").src = defUrl;

gotValue = true;

}

if (iframeResized==false) {

document.getElementById("Nedbrowser").height=

document.body.offsetHeight-

document.getElementById("Nedbrowser").offsetTop-36;

iframeResized=true;

}

}

EPCM.subscribeEvent("urn:/civga/aob" , "Verwijderen" , aobDelete);

function aobDelete(evt)

{

var myId = parent.pageSupport.getIvuId(self);

var myWindow = parent.pageSupport.getIvuFrameWindow(myId);

alert(myWindow.location.href);

var pernr = "Delete#" +evt.dataObject;

var funcName = htmlb_formid+"_getHtmlbElementId";

func = window[funcName];

var ipField = eval(func("pernr"));

ipField.setValue(pernr);

var form = document.all(htmlb_formid);

form.submit();

}

</SCRIPT>

<hbj:content

id="myContext">

<hbj:document>

<hbj:documentHead title="Kaart">

<meta name="description" content="NedGraphics Kaart pagina">

<meta name="author" content="GPR">

<meta name="date" content="Jan. 2006">

</hbj:documentHead>

<hbj:documentBody>

<hbj:page

title="PageTitle">

<hbj:form

id="myFormId">

<hbj:gridLayout

id="myGrid"

rowSize="1"

columnSize="1"

cellPadding="0"

cellSpacing="0"

width="100%"

>

<hbj:gridLayoutCell

rowIndex="1"

columnIndex="1">

<iframe

id="Nedbrowser"

name="Nedbrowser"

width="800"

height="500"

frameborder="no"

marginheight="0"

marginwidth="0"

scrolling="no"

onload="resize_iframe()"

style="position:relative; top:0; left:0; width:800; height:400; z-index:100; visibility:visible"

src="">

</iframe>

<iframe

id="Results"

name="Results"

width="100%"

height="100%"

frameborder="no"

marginheight="0"

marginwidth="0"

scrolling="no"

style="position:absolute; top:400; left:0; width:800; height:200; z-index:100; visibility:visible"

src="about:blank">

</iframe>

<hbj:inputField

id="pernr"

type="string"

maxlength="20"

value=""

jsObjectNeeded="true">

<%

pernr.setVisible(false);

%>

</hbj:inputField>

</hbj:gridLayoutCell>

</hbj:gridLayout>

<br>

</hbj:form>

</hbj:page>

</hbj:documentBody>

</hbj:document>

</hbj:content>

Message was edited by: Baskaran Senthivel

Former Member
0 Kudos

Hallo friends,

Problem solved.I am closing thios thread.

Solution was very simple.Nothing wrong with my code,it is my external service provider(External URL) problem.Once the iframe loaded and when i change the URL at runtime they see the difference on the URL and redirect to LogOFF and the logoff screen is small and empty.

It was very much misleading and confusing.Anyway i found out and problem is solved.

Thanks to the guys who tried to give me some support on this.

Answers (1)

Answers (1)

Former Member
0 Kudos

Check the properties of the iView, particularly the Size properties (width, height etc.)...if one of them is set to automatic, it may need to be specified in pixels to stay the same.

more information can be found here:

http://help.sap.com/saphelp_nw04/helpdata/en/19/4554426dd13555e10000000a1550b0/frameset.htm