cancel
Showing results for 
Search instead for 
Did you mean: 

Refresh Iview (JavaScript )

Former Member
0 Kudos

Hello,

All replies to this will be greatly appreciated.

I need to refresh an iview when the user closes a child window.

<b>Scenario:</b>IviewA. has an EPCF's doNavigate Link that opens a child window without any menu and toolbar.When this child window is closed, IviewA needs to be refreshed.

Iam looking for a solution or javascript that could be placed in the doNavigate to get this scenario working.

P.S:Infact it is like refreshing one of the frames of a parent window when a child window is closed.

Thank you guys.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

HI robert,

I have a javascript that does the same thing..but iam not sure how u cud insert into an EPCF.

Try or wait for someone.

<html>

<head>

<script>

var oChildWindow = null;

var oTimer = null;

function CheckChildWindow()

{

if (oChildWindow.closed)

{

window.location.reload();

window.clearInterval(oTimer);

}

}

function OpenWindow(URL)

{

oChildWindow = window.open(URL, "ChildWindow", "width=600,height=400");

oTimer = setInterval("CheckChildWindow()", 1000);

}

</script>

</head>

<body>

<a href="#" onclick="OpenWindow('http://www.google.com');return false;">Google</a>

</body>

</html>

Thanx.Let me know if it works

Former Member
0 Kudos

Thanx Peter,

I tried but couldn't get pass.

<hbj:link id="link"

text="myLink"

reference=""

target="_TOP">

<% link.setOnClientClick("openWindow('EPCM.doNavigate('ROLES://portal_content/com.sap.....');');return false;"); %>

openWindow is the Java function you gave me.

Do you wanna try??

If i pass any standard URL in openWindow then its working not the doNavigate URL.

Please help me somebody!

Former Member
0 Kudos

Iam not sure why itz not working, but there shud be some way...

I wud try it today...and letz wait for an expert.

Thanx

Former Member
0 Kudos

Hi Robert,

Was just thinking is it possible for you to pass the URL as a variable to the link?

Something like this:

<html>
<head>

<script>
var oChildWindow = null;
var oTimer = null;
<b>var url = "http://www.somesite.com/EPCM.doNavigate('ROLES://portal_content/com.sap')";</b>

function CheckChildWindow() {
 if (oChildWindow.closed) {
  window.location.reload();
  window.clearInterval(oTimer);
 }
}

function OpenWindow(URL) {
 oChildWindow = window.open(URL, "ChildWindow", "width=600,height=400");
 oTimer = setInterval("CheckChildWindow()", 1000);
}
</script>

</head>

<body><a href="#" onclick="OpenWindow(<b>url</b>);return false;">Google</a></body>

</html>

After adding the javascript actual your link might look something like this:

<hbj:link id="link"
text="myLink"
reference=""
target="_TOP">
<% link.setOnClientClick("openWindow(<b>url</b>););return false;"); %>

Problem of course is (if this even works) that for each link you must declare a new variable :\.. Maybe then you could use somekind of array in javascript but let's not go to that yet....

Regards,

Ville Leivo

Former Member
0 Kudos

Did any one find a solution??

Waiting on a Portal Expert!

Former Member
0 Kudos

Hi all,

I look through again the code and here's a example of how you can pass the URL for the popup window.

Just make a .html file and paste this code into it and you see how it works.

<html>
<head>
 
<script>
var oChildWindow = null;
var oTimer = null;
 
function CheckChildWindow() {
 if (oChildWindow.closed) {
  //window.location.href = "http://www.google.com";
  window.location.reload();
  window.clearInterval(oTimer);
 }
}
 
function OpenWindow(URL) {
 oChildWindow = window.open(URL, "ChildWindow", "width=600,height=400");
 oTimer = setInterval("CheckChildWindow()", 1000);
}
</script>
 
</head>
 
<body><a href="#" onclick="OpenWindow('http://www.google.com');return false;">Google</a></body>
 
</html>

Regards,

Ville