Open an image in new external window...

Hi all,
I have an image in the server, say "c:\hai.jpg", through my application i want to open this image in a new external window on click of a button.
I used the following code,
          String file ="C:\images\p.JPG";
          final byte[] content = this.getByteArrayFromResourcePath(file);
          final IWDCachedWebResource resource = WDWebResource.getWebResource(content, WDWebResourceType.JPG_IMAGE);
          resource.setResourceName("p."+resource.getResourceType().getFileExtension());
          try
               final IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(resource.getAbsoluteURL(), "WD_Filedownload", true);
               window.open();
          catch(Exception e){
               wdComponentAPI.getMessageManager().reportException(new WDNonFatalException(e), false);
This code opens a new Internet Explorer, but not the image. When i printed the AbsoluteURL of the resource, its printing null. Where am i going wrong?
Thanks in advance,
Pravin

Hi Armin,
I am using this byte array code
     private byte[] getByteArrayFromResourcePath(String resourcePath)throws FileNotFoundException, IOException
           FileInputStream in = new FileInputStream(new File(resourcePath));
           ByteArrayOutputStream out = new ByteArrayOutputStream();
           int length;
           byte[] part = new byte[10 * 1024];
           while ((length = in.read(part)) != -1) {
             out.write(part, 0, length);
           in.close();
           return out.toByteArray();
Thanks
Pravin

Similar Messages

  • Webdynpro application can't display a URL iView in a new External window

    Fellow developer:
    In my WD4A application, I called the method 'navigate_absolute' to display a URL iView in a new External window.
    The code is as follows:
    data lo_portal_manager type ref to if_wd_portal_integration.
    call method lo_portal_manager->navigate_absolute
    exporting
      navigation_target = 'ROLES://u2026'
      navigation_mode = '1'.            ('0' - Displayed in the Same Window, " '1' - Displayed in a new External Window)
    The application can display the iView in the same Window (navigation_mode = '0'), but cannot in a new External window (navigation_mode = '1').
    In the iView properties, the following attributes are set to:
    1. Launch in New Window - Dipslay in Separate Window
    2. Open iView Links in New Window - Yes
    If you know the answer, please advise.
    Thanks
    Bac Quan

    hi,
    i have the same problem. Did you solve it?. Please let me know...
    regards,
    MC

  • Can an advanced action open an image in a seperate window?

    I am wondering if this is possible.
    I am using an advanced action to Show/Hide an image. I would like the image to open in its own window so the user can move it to compare the pop-up image with the other image and instructions on my slide. (I have a TOC so I have limited space on the slide.)   I think the advanced action might be Execute JavaScript because that choice gives me the option to open in new window.  I am not savvy with writing JavaScript so any help would be great. 
    Thanks
    Jeff

    Hi Jeff,
    Welcome to Adobe Forums.
    In order to open an image in its own window you can go to Properties > Action > On Success > Open URL or File, in the URL box type the name of the image and from the drop down select New.
    After publishing the project, copy and paste the image in the output folder and then you can view the output, this will open the image on a new window.
    I hope it helps.
    Thanks
    Vikas

  • Call selected report in new External window

    Hi ,
    I have a dropdown with 10 reports. say exaploe Report1, Report2......etc
    Now when i selct a Report1 from the drop down and click on PintReport button , I would like call a new External Window. This exteral window should display the data in a table from executed related reportRFC1.
    Please can you give some advice what is the best approach to achieve this.
    Thanks
    Krish

    Hi,
    if you have the output of your reports as HTML, you can easily use this:
    html = htmlheader + htmlBody + htmlfooter;
    final IWDCachedWebResource resource = WDWebResource.getPublicCachedWebResource(html.getBytes("UTF-8"), WDWebResourceType.HTML, WDScopeType.APPLICATION_SCOPE, wdComponentAPI.getDeployableObjectPart(), "Title");
    resource.setResourceName("HTML_inline.html");
    resource.setAttachment(false);
    resource.setReadOnce(false);
    resource.setMakeCopy(true);
    IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getAbsoluteURL(), "New Window Name");
    window.show();
    Maybe you can use wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getAbsoluteURL(), "New Window Name"); In an other way. It's a method, that opens a new Browser Window.
    Best regards,
    Christian

  • Opening a servlet in new browser window

    Does anyone know how you can make a servlet open in a a new browser window when clicking a link for that servlet.
    cheers

    Hi..
    do
    window.open("http://localhost:8080//yourservlet-path//servlet-name");
    you can also set window properties, they are passed as parameters to window.open
    see syntax of window.open. but this thing will open your servlet in a new window with default properties.

  • Create new external window and displays the viewdata as pdf?

    Hi,
    I have developped an application that will display some textviews and one table that displays 5 records,
    for this I want display as new External window and dispay in PDF the data what we have in view.
    advise me how to approach for external window and diplay as PDF.
    Thanks,
    Lohi.
    Message was edited by:
            Lohitha M

    Thanks for your reply,
    Here my problem is now I am getting the table values as output in the Jsp.
    In Jsp I want to create Button when I click that button I need to display an external window and display the table data what ever is available that will display new external pdf.
    I have developped the applcation by using of the three files table.java,tablebean.java,table.jsp and in portalapp.xml cretated the component.
    Now  how can I perform my action in that existed Jsp page and how to display extenal window i that how to generate the PDF.
    I am in learning stage in this.
    please elobarate with atleast some snippests.
    Thanks,
    Lohi.
    Message was edited by:
            Lohitha M

  • Open PDF in New External Window

    Hi
    how to open a PDF Report(File) in new IE Window from WebdynproJava
    Regards
    Dhinakar

    Hi,
             If the PDF document is in the server then we can show that in the external window onClick of the button.
    Write this code in the onAction button event.
    try
    byte[] content =this.getByteArrayFromResourcePath("<server path>\Guide.pdf");
    String stResourcePath = new String("<server path>\Guide.pdf");
    IWDCachedWebResource resource = WDWebResource.getWebResource(content, WDWebResourceType.PDF);
    IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getAbsoluteURL()," document");
    window.removeWindowFeature(WDWindowFeature.TOOL_BAR);
    window.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
    window.removeWindowFeature(WDWindowFeature.STATUS_BAR);
    window.open();
    catch(WDURLException ex)
    catch(IOException ex)
    Paste this code here:
    //@@begin others
    private byte[] getByteArrayFromResourcePath(String resourcePath) throws FileNotFoundException, IOException
           FileInputStream in = new FileInputStream(new File(resourcePath));
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         int len;
         byte[] part = new byte[10 * 1024];
         while ((len = in.read(part)) != -1)
                   out.write(part, 0, len);
                   in.close();
                   return out.toByteArray();
       //@@end
    Regards,
    Vijai

  • Opening file in a new tab/window

    Hi,
    I have a form (HTML added through a widget) and a number of images on one page. I want each image to be a link to a file, where the images will be seen full quality. however, doing this takes visitors away from the page instead of opening a new tab/window - then clicking back means that the form data is lost - i.e. tickboxes are no longer ticked, etc.
    I cannot use the photo viewing page included in iWeb, as the pictures will then overlap with my form because the enlarged images are loaded on the same page.
    I hope this makes sense, and if anyone could help with opening files in new tab/window it would be great, or a way of opening a photo viewing platform in a separate tab/window directly from a click of one of the photos. I have seen other sites - http://www.aroundthebusch.com/Folio/London%20to%20Istanbul.html
    (this is not mine) where the photo viewing "platform" is IDEAL. I would love something just like this if someone could advise.
    i do not want the photos to link to an external page (which can be opened in a new window) as it would mean me creating separate pages for each picture, and linking them all... no way!
    Also, it would obviously be preferable to be quick to set up, but also to change. I would need to have multiple pages of many photos, each with the viewing facilities so it could not take a long time to set up. I may also need to add/delete some photos, so if all the linking work was done automatically it would be fantastic.
    Any help much appreciated,
    Thanks in advance, James

    If you open it in javascript and specify a height/width or location it should open in a new window.
    window.open("http://www.adobe.com", "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=500, left=500, width=400, height=400");

  • Opening sales order in new browser window

    hi experts,
    i have ALV table in which one of the columns is sales order number. I made the column as hyperlink so that user can click on it. when the user clicks on this i am calling an event handler method which is linked on_click event of the ALV interface controller . i am able to capture the sales order number in the method. Now i want to call va03 transaction for this sales order in a new browser window. we are going to integrate this application in portal. any ideas?. i heard something about the object based navigation. how to do this?
    thanks
    Edited by: sudhakar murthy on May 12, 2010 6:04 PM

    Hi Sudhakar,
    Check out the below code to open a Transaction from WD in an external window and pass the value in that Transaction. I am passing the value here in the VF03 transaction's Billing document screen field .
      DATA: url TYPE string,
            host TYPE string,
            port TYPE string.
    *Call below method to get host and port
      cl_http_server=>if_http_server~get_location(
         IMPORTING host = host
                port = port ).
      CONCATENATE host ':' port
      '/sap/bc/gui/sap/its/webgui/?~transaction='
      '*VF03 VBRK-VBELN=123456' " 123456 is the value you are passing into the Billing document screen field of the    
       INTO url.                                      "VF03   transaction
    *get the window manager as we are opening t code in external window
      DATA lo_window_manager TYPE REF TO if_wd_window_manager.
      DATA lo_api_component TYPE REF TO if_wd_component.
      DATA lo_window TYPE REF TO if_wd_window.
      lo_api_component = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
    call the url which we created above
      lo_window_manager->create_external_window(
      EXPORTING
      url = url
      RECEIVING
      window = lo_window ).
      lo_window->open( ).
    Hope it helps you...

  • Open view in a new browser window

    Hi all,
    I want to open a view in a new browser window.
    I try this two code:
    1)IWDWindow window=
    wdControllerAPI.getComponent().getWindowManager().createExternalWindow(
              "http://www.google.it","google",false);
    but in this case i can only open an url...
    2)IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("ExternalWindow");
    IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo,true);
    but in this case it open an internal windows, not an external new browser windows...
    What can i do?
    Thanks!

    Hello Andrea,
    you should call not "http://www.google.it" but result of something like this:
         public static String resolveURL(String dcName, String applicationName) throws EntryNotFoundException, WDURLException
              IWDDeployableObject deployableObject = WDDeployableObject.getDeployableObject(dcName);
              if(null!=deployableObject && WDDeployableObjectState.STARTED.equals(deployableObject.getState()))
                   boolean found = false;
                   int i = 0;
                   WDDeployableObjectPart[] parts = deployableObject.getParts(WDDeployableObjectPartType.APPLICATION);
                   if(parts!=null)
                        for(;i<parts.length;i++)
                             if( applicationName.equals(parts<i>.getShortName()))
                                  found = true;
                                  break;
                   if(found)
                        return WDURLGenerator.getApplicationURL(parts<i>, null);
                   else
                        throw new EntryNotFoundException( "Application '" + applicationName + "' not found" );
              } else {
                   throw new EntryNotFoundException( "Application '" + applicationName + "' not found in '" + dcName + "'" );
    Best regards, maksim Rahchnski

  • Open discoverer report in new browser window and without connections page

    Hi All,
    We are using Oracle 11g Discoverer 11.1.1.4.  Requirement is to open the discoverer report in a new browser window and without connections page.
    When we are running discoverer reports with this parameters we unwantedly get the connections page of the discoverer plus which we don't want.
    Went through the documentation given in this page and followed it still the issue persists, and i see couple of threads with my issue and no updates.
    This excerpt is from the documentation available in the link
    " _plus_popup=true and framedisplaystyle=embedded launches Discoverer Plus in a new pop-up browser window that contains the Plus applet embedded in it "
    http://www.art2dec.com/documentation/docs/oas10g1012/linux/bi.1012/b13918/urlstart.htm
    and Here is what we use to invoke our reports.
    http://ipaddress:port/discoverer/plus?cn=cf_123&_plus_popup=TRUE&framedisplaystyle=EMBEDDED&wb=disc_wb_1
    Request the forum users from PRO discoverer group to help me out of this issue and expect a good discussion on this.
    Thanks in advance

    Closing the thread
    We were able to achieve by changing the browser settings in the IE 8 Browser. Disabled Tabbed browsing.

  • Open URL Link in new browser window

    Can someone please help me? I've tried to use code as if I were using Dreamweaver without any luck(i.e. blank target).
    Is there a way to make the url in the PDF open a new browser windows once clicked? Hopefully this is an easy fix! Thanks in advance!

    Jono, if you are still out there.  I am also having trouble with this function.  The button works just fine, but it does not open another browser window.  I am trying to keep my pdf open, and send them to a url.  That way they can come back to the form. Like you would with the target="_blank" function in javascript.
    What am i doing wrong?  I have tried opening the script editor, but I am not sure what to do there. So I put the same as you did on your form, no effect.  I put target="_blank" and set it to javascript on just about every option.  I have tried to go into the code on the xml source tab, no luck anywhere.  I have tried to just use a text field, no luck.
    Seems like everything I have tried has no effect.
    Hopefully you can tell me it is something simple...
    Thanks in advance.
    Jodi

  • Opening driving directions in new browser window

    I have installed the Web Assist Google Pro Maps extension and
    would like for the div containing the driving directions results:
    <div id="wagmp_directions_2"
    to appear in a new browser window.
    However, when I open the tag inspector, it says "locked
    region" for the Google maps divs, even though I detached the php
    page from the template. Any ideas?
    http://www.lindafarronknapp.com/map.php

    Sorry, mixed up my versions a bit. The following code doesn't open a new window.
    try {
                JSObject window;
                window = JSObject.getWindow(this);
                URL url = new URL(this.getCodeBase(), "mydomain/mypage.jsp");
                window.eval("window.open(" + url +")");
            catch (Exception e) {
                e.printStackTrace();
    }It doesn't do anything, instead I'm getting the following output in the trace:
    liveconnect: the url of the applet is http://localhost:29080 and the permission is = false
    liveconnect: JavaScript: UniversalBrowserRead enabled
    liveconnect: JavaScript: UniversalJavaPermission enabled
    liveconnect: JSObject::eval(window.open(http://localhost:29080/mydomain/mypage.jsp))
    liveconnect: the url of the applet is http://localhost:29080 and the permission is = falseI'm testing this code on Linux, FIrefox 1.5.0.3 and JDK1.5.0_07.
    What I'm doing wrong?
    Thanks.
    Stephan

  • How to open the link in new firefox window for web desktop based application? Or how to open the mail/website/rss link in new firefox window

    I am using the firefox 3.6. My problem is that I am using the web desktop and few web desktop based application directly opens link. If I click on rss link than it opens in same window, so no longer access to web desktop. I want to open any kind of link in new window instead of same window. I have tired to change the value of browser.link.open_newwindow, browser.link.open_newwindow.restriction but doesn't work. Also gone through the https://developer.mozilla.org/en/window.open but not sure where to do this in web desktop based application or firefox where we connect the web desktop?
    Is there any way to open the link every time in new firefox window?

    Hi Joseph,
    the HTMLB link object misses the support for onClientClick through the tag lib, see hbj:link without onClientClick ? and OnClientClick Event for Link HTMLB Component for similiar problems and workarounds.
    With this workaround, you can call for example an AbstractPortalComponent, implement doOnNodeReady (with an empty doContent method) and return the PDF, settings the content type on the http before etc.
    Hope it helps
    Detlev
    PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!

  • How To open a PDF in New Native Window in Air

    Hi All,
    I have a Air application.I want to open an pdf located in desktop in new native window.
    Thanks,
    Amol.

    There is no easy way to implement this. Its better to instruct users the shortcut to open the link in new window.
    --Cheers

Maybe you are looking for

  • How can I remove Windows XP from my MacBook Pro?

    I've tried everything I can find to get rid of Windows XP on my MacBook Pro.  I have OS X 10.5.8 and, unlike later versions, BootCamp Assistant 2.0 doesn't allow the option to restore the disk.  And I can't find an update to BootCamp anywhere that wi

  • In need of a 2.6.18.4 kernel package

    Hi, does anyone have a 2.6.18.4 kernel package laying around? I upgraded to 2.6.19 a couple of days ago and today found out that 2.6.19 breaks rtorrent. I want to downgrade until the problem is resolved but i don't have 2.6.18.4 in cache directory an

  • SSIS How to set Tolerance levels via parameters

    Hi all I am after some help as pretty new to SSIS. I need to write some validation requirements on data which needs to be in SSIS. What I want to achieve is setting Tolerance levels on two fields. Field A has a tolerance lvl of 0% Field B has a toler

  • How to uninstall third-party visualizers on iTunes?

         To be specific I cannot uninstall the visualizer "Cubism". It required that I put a qtz file (Cubism) into a folder called "Compositions" (already provided for in the little window you open from the dmg) and then drag it into ~/Library/Compositi

  • Loading on two platforms

    I just bought lightroom 4 for my daughter. It is the student version. Before I load it on to the home PC I want to make sure it can be loaded onto her MACPRO laptop as well. Some software programs can only be loaded onto one machine? Thanks