To open an external URL from your application

Hello All,
Please guide me in below scenario as I am new to SAP UI5.
I have created a SHELL application with 5 tabs.
We have a requirement where on clicking of a tab in the application it should open an external url. I am using "link" element of sap.ui.commons library. On press of link to action function I am using below code to open external url content.
location.href = "http://google.com";  
It is opening in the same tab but I have been navigated away from my application.
As per the requirement external url content should be opened  without navigating away from my application.
I am attaching the screenshot.
Thanks
Ansuman

Hi Jagadeesh,
See this code for reference.
This is my view.
sap.ui.jsview("demo.view1", {
       /** Specifies the Controller belonging to this View.
       * In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
       * @memberOf demo.view1
       getControllerName : function() {
              return "demo.view1";
       /** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.
       * Since the Controller is given to this method, its event handlers can be attached right away.
       * @memberOf demo.view1
       createContent : function(oController) {        
                     var btn1 = new sap.ui.commons.Button({
                           text: "This Is View One."
                     var link = new sap.ui.commons.Link({
                           text: "view3",
                      press : function() {                          
                            $("#frameId").slideDown();                                 
                     var iframe = new sap.ui.core.HTML("frameId",{
                      content : "<iframe src=" + 'http://www.jnvbuxaralumni.com' +" width='100%' height='700px'></iframe>",
                     var ele = [btn1, link, iframe];
                     return ele;         
This is my controller.
sap.ui.controller("demo.view1", {
       onAfterRendering: function() {
              $("#frameId").hide();
This is my index.html.
<!DOCTYPE HTML>
<html>
       <head>
              <meta http-equiv="X-UA-Compatible" content="IE=edge">
              <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
              <script src="resources/sap-ui-core.js"
                           id="sap-ui-bootstrap"
                           data-sap-ui-libs="sap.ui.commons,sap.ui.ux3"
                           data-sap-ui-theme="sap_bluecrystal">
              </script>
              <!-- add sap.ui.table,sap.ui.ux3 and/or other libraries to 'data-sap-ui-libs' if required -->
              <script>
                           sap.ui.localResources("demo");
                           //jQuery.sap.require("sap.ui.core.routing.Router");
                           //jQuery.sap.require("sap.ui.core.routing.HashChanger");
                           var oShell = sap.ui.ux3.Shell("shellId",{
                                  appTitle: "Shell Demo Program",
                                  showLogoutButton: false,
                                  showSearchTool: false,
                                  worksetItems: [
                                         new sap.ui.ux3.NavigationItem("homeId", {
                                                key: "view1",
                                                text: "Home"
                                         new sap.ui.ux3.NavigationItem("contactUsId", {
                                                key: "view2",
                                                text: "Contact Us"
                                  worksetItemSelected: function(e){
                                         this.removeAllContent();
                                         var selected = e.getParameter("key");
                                         var view = sap.ui.getCore().byId(selected);
                                         //console.log(selected);
                                         if( view == undefined){
                                                view = new sap.ui.view({
                                                       id: selected,
                                                       viewName: "demo." + selected,
                                                       type: sap.ui.core.mvc.ViewType.JS
                                         this.addContent(view);
                                  content: [
                                                new sap.ui.view({
                                                       id: "viewId1",
                                                       viewName: "demo.view1",
                                                       type: sap.ui.core.mvc.ViewType.JS
                           oShell.placeAt("content");
              </script>
       </head>
       <body class="sapUiBody" role="application">
              <div id="content"></div>
       </body>
</html>
Here you can see that on click of the link button i am able to display frame in same tab of shell.
Let me know if it's helpful.
Regards
Dhananjay

Similar Messages

  • Opening an external URL from the Web UI

    Hello,
    I want to use the Web UI in order to open an external URL.
    I know it can be done easily using JavaScript, but the URL is generated from one of the page controller methods, and I want to open it directly from there.
    I know that there's the Window Manager in the Component Controller, that can open popup windows, but none of it's methods receive an external URL.
    So how can I open an external URL from the Web UI methods?
    Thanks,
    Udi.

    Hi,
    you can use the Trnsaction launcher with OP.
    in the window you create an OP_X
    with the code
      data: lv_navigation type ref to     if_crm_ui_navigation_service.
      lv_navigation = cl_crm_ui_navigation_service=>get_instance( me ).
      lv_navigation->navigate( iv_link_id = 'ZTO_X' ). "runtime you create the TO_X nevigation"
    in your implamentation class of the view you add a preotected method OP_TO_X with the code
       data:
        lr_window type ref to cl_bsp_wd_window.
      lr_window = me->view_manager->get_window_controller( ).
      lr_window->call_outbound_plug( iv_outbound_plug = 'TO_X'
                                     iv_data_collection = iv_data_collection ).
    and you call to that method from the EVENT_HANDLER you want.
    Amit.

  • Link to external URL from flash site

    Is there any way to link to an external URL from your flash
    site without having the flashplayer prompt you to change your
    settings and allow access to that page? (this only applies to swfs
    viewed through a browser)
    the only way around this i've found isn't very useful - you
    have to put a small xml file on the host server where the page you
    want to link to is located. i seriously doubt every site you want
    to link to will allow you to put an xml file on their host server
    just so you can link to their page. the code in the xml file just
    tells flashplayer that the site you are trying to access is safe.
    it's called crossdomain.xml
    anyone have an answer?
    thanks!

    This question was answered by kglad, on Saturday, August 11,
    2007 10:13 AM
    Answer
    no it doesn't. getURL() causes no security issues unless you
    try to open the html locally and (try to) access something on the
    internet.
    unless your "flash site" is your local computer there is no
    security issue. if your local computer is an internet server, you
    just need to set the security settings for your local file and give
    it permission to access the internet zone.

  • Link to external URL from online swf

    Is there any way to link to an external URL from your flash
    site without having the flashplayer prompt you to change your
    settings and allow access to that page? (this only applies to swfs
    viewed through a browser)
    the only way around this i've found isn't very useful - you
    have to put a small xml file on the host server where the page you
    want to link to is located. i seriously doubt every site you want
    to link to will allow you to put an xml file on their host server
    just so you can link to their page. the code in the xml file just
    tells flashplayer that the site you are trying to access is safe.
    it's called crossdomain.xml
    anyone have an answer?
    thanks!

    no it doesn't. getURL() causes no security issues unless you
    try to open the html locally and (try to) access something on the
    internet.
    unless your "flash site" is your local computer there is no
    security issue. if your local computer is an internet server, you
    just need to set the security settings for your local file and give
    it permission to access the internet zone.

  • Navigate to external URL from secured APEX server

    NOTE I am using the internal Oracle APEX server to host my application, so it may be possible that you will have to be an Oracle employee with the same access, or using a similar setup, in order to respond. Even if you are not, if you feel inclined to "take a swing" at it, keep this in mind.
    Hi all,
    I am using the internal APEX server at oracle to host an application (Application Express 4.0.2.00.07). I have other, NON-APEX applications hosted on other servers within the Oracle firewall.
    On page 0 of the APEX application (which, as you may know, usually displays as the "header" section of every other page in the application) I have created a select list of the other projects and their associated URLs as well as a "Go" button, so users that want to navigate to the other applications can do so from this application. Since page 0 does not seem to allow the creation of standard branch items (please correct me otherwise), I have created a process on that page triggered by the "Go" button. The process currently contains the following code:
    begin
    apex_application.g_unrecoverable_error := true;
    htp.p('<script language="JavaScript">
    window.open (:P0_PRODUCT_PAGES); <!-- :P0_PRODUCT_PAGES being the URL of the selected non-APEX application -->
    </script>');
    end;
    That code currently replaces the existing page with a blank page and the associated URL is "https://apex.oraclecorp.com/pls/apex/wwv_flow.accept". I am assuming this means that APEX was looking for an application ID and/or page and did not get it so it "stopped" at this page.
    I am unaware if there are any settings on the APEX server, DB,or associated web server preventing me from navigating outside of APEX once I am running the hosted application.
    I would like to launch another properly-sized (default) browser window rather than replace the existing window pointing to the URL for the selected application.
    I have also tried using the owa.util code to try to generate the proper URL but was likewise unsuccessful.
    NOTE: I am not looking for different ways to do this by changing server parameters, settings, etc. since I do not have server rights to do this. Additionally, due to time constraints, I would prefer not to be drawn in to a discussion of the comparisons and/or benefits of owa.util or javascript over the other for navigating to an external URL from within APEX, etc. (I'm not trying to be a "punk", but I AM under the gun to resolve this with very limited time). In light of this, please indicate if you have a working option to do this under similar conditions that I can implement quickly. I have done much research within the forums and Googled extensively for information from outside sources but have not yet found something that will provide the proper results.
    If you are an oracle employee and wish to contact me directly, please email me at [email protected]
    Crossing my fingers and hoping someone has done this before.
    Many thanks in advance; your useful contribution will actually contribute to lessening the world's INSOMINA factor considerably (mostly mine). ;)

    >
    I would like to launch another properly-sized (default) browser window rather than replace the existing window pointing to the URL for the selected application.
    I have also tried using the owa.util code to try to generate the proper URL but was likewise unsuccessful.
    >
    Opening a URL in a new tab or window has to happen in the browser, without submitting the page. The server doesn't know about browser windows. Use:
    onchange="window.open(this.value);" in the HTML Form Element Attributes property of <tt>P0_PRODUCT_PAGES</tt> (making the "Go" button unnecessary), or, if the "Go" button is required to match the LAF:
    onclick="window.open($v('P0_PRODUCT_PAGES'));"in the button Attributes property, ensuring the button is a template button including the <tt>#BUTTON_ATTRIBUTES#</tt> substitution string, e.g.
    <input type="button" value="#LABEL#" #BUTTON_ATTRIBUTES# />Ensure that absolute URLs are used in the <tt>P0_PRODUCT_PAGES</tt> where necessary, specifying the correct scheme for the site, so that you are not trying to go to <tt>{noformat}https://apex.oraclecorp.com/pls/apex/www.google.com{noformat}</tt> for example:
    f?FOO:BAR:&APP_SESSION.    // other APEX app hosted on apex.oraclecorp.com sharing the same authentication scheme
    https://foo.oraclecorp.com // other secured internal site
    http://www.google.com      // unsecured external site

  • Open a Dynamic URL from a Table column link

    Hi,
    Jdev Version (11.1.1.6.0)
    I have requirement to open a dynamic URL from table column. Any time I click on link, it should generate dynamic URL based on column attribute and open in popup or browser. Can someone pls suggest how to achieve this.
    Thanks
    Ank

    1)If you have any parameters that needs to be passed to build that dynamicURL, just set a propertyListener on the column attribute and get the value.
    2)Then on the af:commandLink action, build your dynamicURL with the required parameters.
    3) If you URL is all together a different application which doesn't share your transaction, you can open it as below
    In the below code, urlWithParams will be your dynamicURL.
    ExtendedRenderKitService erks =
    Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
    StringBuilder sbURL = new StringBuilder();
    sbURL.append("window.open(\"" + urlWithParams + "\");");
    erks.addScript(facesContext, sbURL.toString());
    You can also try the above response by user 948181.
    Hope it helps.

  • Opening an external url in the same browser

    Hi all,
    I need to open an external URL (for instance,www.google.com) from my WDA application by 'linktoaction' or 'button' event and this should be happen in the same parent window and not as a external window.
    Please suggest me steps with example codes to perform this.
    Regards,
    Dinesh

    Why use a linktoaction?  Just use a linkToURL.
    [http://help.sap.com/saphelp_nw70/helpdata/EN/49/e8884118aa1709e10000000a155106/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/EN/49/e8884118aa1709e10000000a155106/frameset.htm]
    You can use the target property to control how the link opens. 
    If you must use a button or linkToAction, the you will have to use an Exit Plug:
    [http://help.sap.com/saphelp_nw70/helpdata/EN/45/1bc575ba064574e10000000a114a6b/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/EN/45/1bc575ba064574e10000000a114a6b/frameset.htm]

  • Open the external URL in another tab of window browser

    Hi,
    I have create application to open the external URl into new window browser by using CREATE_EXTERNAL_WINDOW method. now how can i open this url into same window tab. is there any method that allow me to open this external URL into window tab.
    Thanks,
    Digamber.

    The open external window API doesn't support specifying "in another tab". That is completely browser specific! Some browsers don't even have tabbed browsing.[ I don't even think that even javascript has this functionality!|http://www.dynamicdrive.com/forums/archive/index.php/t-19843.html]
    You'll not be able to do this. Sorry.
    You might be able to change the browser configuration so that it defaults new windows into a new tab... But not through WD.
    Cheers,
    Chris

  • Do view life time and view recent property apply for external URL from crawling?

    Hi All,
    I wonder that do viewlifetime count and viewrecents apply for the external URL from the crawler?
    I saw it does work for local SharePoint URL but not too sure for the external URL.
    And in that case, is it possible to sort the search result by viewlifetime/viewrecent for both Local SharePoint Sites and External Site from crawler?
    Best Regards,
    Andy

    Hi,
    According to your post, my understanding is that you want to use viewliftime and viewrecent property when crawing external URL.
    Per my knowleage, the viewlifetime and viewrecent property does not apply for external URL from crawling.
    In my environment, I can edit the refinement panel in search center page to display viewlifetime and viewrecent when I crawl SharePoint Sites.
    However, when I crawl external site, in the search center page, I cannot get any information about the result items.
    Here is a great blog about how to crawl external site for your reference:
    http://www.bluesphereinc.com/blog/utilizing-the-power-of-sharepoint-search-part-1-centralizing-search-results-from-mulitple-sources/
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Opening a URL from an application

    Hi everyone, am not quiet skilled with java but i would really appreciate your help with this, as i couldn't find a solution which made me doubt my whole basic knowledge of java. Now am doing this for my school project, it's a speech recognition application that will convert speech to text, there are 2 buttons in my interface, one "start" where you start speaking , the other one "stop" which would allow the engine to start processing the speech and converts it to text, it will then open a web page which in my case is a search engine(say google or yahoo) and searches for the matching documents of what has been spoken.
    my problem is that i need to open that certain URL ( predefined) from a running application and not an applet, it hasn't worked for me, This is the only problem. is it possible ? please i need your help with this , i'd really appreciate it if someone would help ... thanks a lot for your time.

    hii guys am really sorry for the confusion ,the problem was actually with the java security poilcy not with the code as i thought.. i thought my code was wrong but it turned out to be correct.. here it is for anyone who's interested... but thanks anyway for everything... tc
    Runtime rt = Runtime.getRuntime();
    rt.exec("C:/Program Files/Internet Explorer/iexplore.exe http://www.google.com/search?hl=en&q=hi+my+name+is+omaya");

  • Open url from my application??

    Hi guys,
    I'm using jdev 10.1.2 and adf bc's. In my application i have a table which stores links for a number of websites. So I have a jsp which lists all the records from this table. When the user clicks on the link, the relevant page should open up in a new browser.
    here's the code:
    <a href ="<c:out value="${Row['Link']}"/>" target="_blank"><c:out value="${Row['Link']}"/></a>
    The problem is that while the href has the value of the link, it tries to launch the link from my application so that the URL is:
    http://10.64.102.92:8990/Trademarks-View-context-root/www.google.ie
    instead of just http://www.google.ie
    any ideas of how to remove the part preceeding the address would be most welcome.
    thanks in adavance,
    newbe.

    sorry, problem solved. i just had to put http:\\ in front of the value of the c:out

  • Open external URL from Homepage Framework

    Hi,
    We are building our new ESS functionality with Homepage Framework and I need to create some links to external URL. I would like them to open in a different window with no portal header at all. They should appear as services listed in the menu area. While this seems easy, I had tried several things with no success.
    First, I created an URL iview in portal content. I marked the option "launch in external window" to Open in a separate window.
    I create a resource that pointed to this Iview, and linked resource with a "java webdynpro" service, service with subarea and subarea with area. The service link is displayed correctly but it is always opened in the portal page, not in a different one.  Have i forgotten any parameter that would make this work?
    A second approach was to create a resource that includes the URL and an associated service, marked as "Direct URL launched in separate window".
    This succeds in calling the URL in a differeny window but it adds some strange parameters at the end. So instead of calling http://www.google.com it calls  something like http://www.google.com?sap-ext-sid=2J*HeTVW7295w3QWBZhQow--
    jQDfzgrDHRt*yZ87GlXsgA--%2Fpcd%3Aportal_content%2Fcom.bshg%2Fpct%2Fhcm%
    2FEURO%2FES%2FESS%2Froles%2Fcom.bshg.hcm.ess-es%2FESS%
    2Fcom.bshg.hcm.infoLinks%2Fsap.com%2Fpcui_gp%7Exssutils%2FXssMenuArea%
    2Fbase&sap-wd-arfc-useSys=SAP_R3_SelfServiceGenerics%3AHR0&sap-wd-
    cltwndid=WID1325147123879&sap-accessibility&sap-locale=es&sap-rtl&sap-
    epcm-guid=validate&sap-wd-renderMode=viewArea&sap-pp-
    consumerBaseURL=http%3A%2F%2Fu3d.bshg.com%3A80&sap-ep-
    version=7.0108.20110207041646.0000&sap-wd-tstamp=1325147150353&sap-
    cssversion=7.11.7.30.0&sap-pp-producerid=com.bshg.BSHG_HCM_EMEA&sap-wd-
    app-namespace=zzzz&sap-cssurl=http%3A%2F%2Fu3d.bshg.com%3A80%2Firj%
    2Fportalapps%2Fcom.sap.portal.design.urdesigndata%2Fthemes%2Fportal%
    2Fcustomer%2Fbsh%2Fur%2Fur_ie6.css%3F7.1.8.0.1&sap-wd-finish-
    rendering=false
    While some pages can ignore those extra parameters, in other cases, this causes a "page not found" error.
    Any ideas on how to solve this problem?
    Many thanks in advance to all.

    Hi Daniel,
    Define Resource: you have to mention all the below details
    1. object name :http:// (url ).
    2.window name: "".
    3.window Property : target="_blank".
    and also check define service:
    service type: Direct url launched in a seperate window.
    And assign resouce to service -
    >
    service to sub area--->
    sub area to area---->
    area to areagroup.
    hope it helps............,
    Thanks,
    cbr.

  • Help Needed in opening a HTML File from swing application

    Hi,
    I am opening a HTML file in Internet Explorer from my swing application.
    I am using the code given below
    private final static String WIN_FLAG = "url.dll,FileProtocolHandler";
    private final static String WIN_PATH = "rundll32";
    String cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
    // url is HTML file Path
    Process p = Runtime.getRuntime().exec( cmd );
    The HTML file is opening up,but it always opens behind the swing application,that makes me every time to maximize the HTML file after it being opened up.
    I want to open it in front of the Swing Application.
    Any Help Please ?
    - Manikandan

    Check your Application's JFrame properties (may be ur Frame is set to be in top position ,always),and also check running your application in some other OS.

  • Form field to open a external URL passing  the value typed by user in URL

    I am trying to build a text field with a "Go" button beside it so that when a user types in a value (e.g. a bug number) in this text field, it opens up a external URL (e.g. bugdb URL) with the parameter being passed in the URL. e.g:
    P1_SEARCH (Text field): 464666 (value)
    So when I click on the Go button beside it, I want a URL to open in a new browser with the following URL:
    http://xxxx.oracle.com/pls/edit_info_top?report_title=&rptno=:P1_SEARCH (P1_SEARCH should be replaced at the run time)
    I tried using the branching and javascript:popupURL but I was not able to achieve the above mentioned flow.
    Also, I noticed that when I try to create a button in a region selecting the option "Create a button displayed among this region's items", a javascript:doSubmit is automatically associated with it. Is there any way of changing it to javascript:popupURL?
    Can somebody help me to resolve this issue? Thanks in advance.

    Narayan,
    Please don't post the same question twice. If you don't get an answer, it's OK to "bump" it by replying to your own question. You've already asked this question here:
    issues while invoking external URL
    Sergio

  • Can we open an external window From ESS DC?

    Hi,
    Can we open an external window on the click of a button in an <b>ESS dc</b>?
    I am trying to call another web dynpro application as an external window from ESS DC.
    I am doing something like this in the action handler method:
    IWDWindow window = wdComponentAPI.getWindowManager()
         .createExternalWindow("http://hostname:port/webdynpro/dispatcher/local/FirstAction/TestApp?SAPtestId=2", "Test", false);
         window.open();
    It doesnt work. Am I doing something wrong?

    Solved it myself

Maybe you are looking for

  • How to customize Category and Category items list while creating New Model

    Hi, what the most convenient way to customize the Category and Category items list while creating New Model? This is standard: Now, what we want to achieve, is to customize this menu, to: 1. Display in the Category window only f.e. two categories: -

  • FPGA crio

    Buenos días a todos. Llevo un tiempo trabajando con Crio ni-9022 y un chasis que incluye FPGA , y me da unos errores cuando compila la FPGA, que me son imposible de detectar ya que nombre variables a nivel de FPGA. El fallo es el siguiente: LabVIEW F

  • How can I copy/paste a page from one pages document into another pages document?

    I have read the directions in the manual, but when I go to the document where I want to put the page the paste function is greyed out.  I assume this has something to do with styles, but can't find what to do. 

  • OMW hangs on mapping some databases

    Hello: I am migrating about 20 databases from MS SQL 6.5 to Oracle 8.0.5. 15 of the databased migrate flawlessly, but 5 of them hang on OMW during the mapping phase. I have to "End Task" the program to get it to stop. I have played with the source mo

  • Tip for upgrading from MBP to iMac with Leopard & Parallels Boot Camp

    Here are some pointers based on my recent experience upgrading from a MacBook Pro to an iMac, under Leopard and with Parallels using a Boot Camp partition for Windows. First, you do not need to create a Windows partition on your new computer. You wil