on 02-21-2007 6:49 AM
Hi,
Objective: I would like to call URL from ICWC view.
During runtime, I could see the view with link button "Link to Google".
Case I: If I press right click button by putting cursor on "Link to Google",
I can see new window opened for google.com.
Case II: If I press left click button by putting cursor on "Link to Google",
I come across following error message:
"The requested URL /?sap-syscmd=nocookie was not found on this server"
Segment of code for ready information:
View Laout:
...
<htmlb:link id = "link1"
text = "Link to Google"
reference = "http://www.google.com/"
onClick = "MyLinkClick" />
...
Controller class method "DO_HANDLE_EVENT"
...
IF htmlb_event IS NOT INITIAL.
CASE htmlb_event->server_event.
...
WHEN 'MyLinkClick'.
IF htmlb_event->name = 'link'.
DATA: link_event TYPE REF TO CL_HTMLB_EVENT_LINK.
link_event ?= htmlb_event.
navigation->goto_page( link_event->reference ).
return.
ENDIF.
ENDIF.
Valuable suggestions please!
With Regards,
Priya
Priyanks,
In case you have a fixed URL use following code:
<htmlb:link id="link1" reference="http://www.google.com" target="_blank" text="Ext Link"></htmlb:link>
Since you are in ICWC view I'd rather sugget to use CRM_BSP_IC extension over HTMLB.
Cheers,
Ankur
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanx Ankur,
Replaced extension "HTMLB" with "CRM_BSP_IC".
It couldn't work out with target="_blank".
with addition of "onClientClick", I could see "google" window opening with left mouse click button, but not able to navigate back. But the same is working for right mouse click button.
onClientClick = "window.open('http://www.google.com',
'Custom Google', 'resizable=yes,height=850,
width=700,dependent=yes,status=1');"
Is there any way?
With Regards,
Priya
Hi Ankur,
Once again thanks for your quick response.
I would like to call URL from ICWC view.
On a view, navigational link "Link to Google" ic created through "Link".
1. If I press right click mouse button, new window gets opened for google.com.
If I close, newly created window, I can see previous page.
I am fine with this. No action required.
2. If I press left click mouse button, new window gets opened for google.com.
If I press "back", I can not navigate to previous page.
Requirement: I should be able to navigate back.
After pressing on "back" button, I used to get following error message:
Warning: Page has Expired
This page is no longer available.
I made the application as "stateful" also, but the error still persist.
I would like to resolve this.
Please ask if any further clarification is required.
With Regards,
Priya
Priyanka,
Since I dont know, I assume that the URL for the link to be opened is always static say "http://www.google.com"
ICWC behaves erratically if you load any external page in it. This is due to session expiry. You could easily test this by just refreshing browser on any view.
I fear you may not be able to navigate BACK to ICWC if you open an external page in same window, however if ok then you could open the link in new window (EVEN WITH LEFT CLICK). This way the IC sesion would be preserved.
Cheers,
Ankur
There are 2 ways to do this (quite easy)
1. to use direct opening with no code:
<crmic:link id="lnk1" text ="Link1" reference ="http://www.google.com" target= "_blank" />
This is also mentioned in my first reply.
2. to use window.open to open a new window:
*****************************************************
<script>
function open_me()
{
var url = "http://www.google.com" ;;
new_window = window.open(url,"_blank","");
}
</script>
<crmic:link id="lnk1" text ="Link1" onClientClick="javascript:open_me()" />
*****************************************************
This should resolve the query, let me know if this doesn't work.
Cheers,
Ankur
Thank you very much Ankur,
I followed two ways suggested by you.
1. To use direct opening with no code: It worked out completely.
Means on click of left & right button, I could see new window opened.
And after closing new window, back navigation is possible.
2. To use window.open to open a new window:
It worked partially.
On click of left button, I could see new window opened.
But on click of right button, new window gets opened with error,
which is as under:
"The page cannot be displayed"
If possible answer for second case, but you have given me valuable information.
Best Regards,
Priya
Hi Priyanka,
Most web applications which needs to open a page with a dynamic URL follows approach 2 (above post).
The right click on lijnks actuallly opens the page which has the URL mentioned under "reference" attribute. Since in second way, there is no "reference" attribute hence it opens a blank/error page.
Even in ICWC I would not recommend to open any link with right click since it may lead to erratic behavior (due to same seeion ID).
Cheers,
Ankur
Priyanka,
Below is code sample that runs on left click and right click.
<script>
function newwin()
{
var win = window.open("http://www.yahoo.com","_blank");
}
</script>
<htmlb:link id="lnk" onClientClick="newwin()" reference= "http://www.google.com" text="click me" ></htmlb:link>
The reference property is responsible to open any link in new window since it doesnt trigger the onClientClick() event.
Cheers,
Ankur
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.