on 08-10-2005 5:54 PM
Hi everybody,
I've created an iView (AbstractPortalComponent) with links to different r/3 transactions (the links are generated URL thanks to IIViewUrlGenerator). Therefore when I click the link the transaction is launched in the same iView. What I would like to do it that the transaction is launched in another iView in the same page (target iView). So that the iView containing all the links is still visible (kind of navigation iView).
But I don't know how to do that. I am sure there must be a easy way to set the URL generated by IIViewURLGenerator as the target iView's content. I just know how to communicate between iViews (using EPCF) but I don't see how to set the URL as the target iView's content.
Any idea?
Thanks in advance
Renaud
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In order to test I created two simple iViews. The first one send the google web page url to the target iView which is therefore supposed to display google's web page.
sender's doContent() :
String myUrl = "http://www.google.fr";
response.write("<script language='JavaScript'>");
response.write("EPCM.raiseEvent('namespace', 'myName', '" + myUrl + "');");
response.write("</script>");
Receiver's doContent() :
response.write("<script language='JavaScript'>");
response.write("EPCM.subscribeEvent('namespace','myEvent', setUrl);");
response.write("function setUrl(evt) {"
+ "var urlPassed = evt.dataObject;"
+ "document.write(urlPassed);"//just to check the url was passed
+ "var ivID = parent.pageSupport.getIvuId(); "
+ "var myIFrame = parent.pageSupport.getIvuFrameWindow(ivID);"
+ "myIFrame.location.href = urlPassed;"
+ "parent.pageSupport.ivuRefresh(ivID);"
+ "}");
response.write("</script>");
The URL is correctly passed to the receiver iView but I can't see google's webpage in the target iView. There must be a mistake in my code but I can't see it. Any idea?
Renaud
Hi Yoav,
thanks a lot it works! But I've got a weird behaviour from my iViews :
This is my code :
Sender
<script>
EPCM.raiseEvent('urn:myOwnNameSpace', 'doNavigateURL', "http://www.yahoo.fr");
</script>
Receiver
<script>
EPCM.subscribeEvent( 'urn:myOwnNameSpace', 'doNavigateURL', handle_donavigateURL_Event);
function handle_donavigateURL_Event(evt) {
var url = evt.dataObject;
document.write("<IFRAME src=" + url + "></IFRAME>");
}
</script>
When I launch the page containing the 2 iView the yahoo web page is actually displayed into the sender iView! Why??
Moreover when I click a link in yahoo the link is displayed in the whole page and not in the iFrame anymore.
Renaud
Message was edited by: Renaud Theuillon
Hi Renaud,
You can use EPCF for this. On clicking the link on one iview u have to pass the url as parameter. For transfering data u can use client data bag.
Syntax of that is
storeClientData("namespace",key,value);
loadClientData("namespace",key);
You can retrive the url string from the data bag at the target iview and load that iview with that url.
Hope this Helps
gEorgE
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi renaud,
You can explicitly write an IFRAME tag in your form using myForm.addRawText(), and control the IFRAME src.
If you insist on using two iViews, the "navigation" iView will save the url in the Client Data Bag and raise an event to the "content iView", that will contain the IFRAME tag, snd set its src upon event.
Hope that helps,
Yoav.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.