Closing the window - web dynpro Java

Hi all,
Do you know how to close the window when the user clicks on a button in web dynpro java?
Thanks for your answers.
Karim

Hi,
Declare two methods in ComponentContrroller
like openWindow() and closeWindow()
And in openWindow method write
String winName=<anotherWindowName>;
objWindow =
wdComponentAPI.getWindowManager().createModalWindow(
wdComponentAPI.getComponentInfo().findInWindows(strWindowName));
objWindow.setWindowSize(150,200);
objWindow.open();   
Declare objWindow of type IWDWindow between
//@@begin others
//@@end
In closeWindow() method write
if(objWindow!=null)
   objWindow.destroy();
   objWindow=null;
On your button click just call these methods to open and close external windows like
wdThis.wdget<CompController>().closeWindow();
Regards
LN

Similar Messages

  • IView Personalization (Web Dynpro Java) for Anonymous User

    Hello All,
    Is it possible for anonymous user to see iView personalization (Web Dynpro Java) when personalized by an administrator?  What I did was create new role and iView making available to anonymous user.  This work fine meaning I can view iView using URL http://<servername>:<port>/irj/portal/anonymous .  But the personalization I made to iView using administrator mode launching iView in preview mode and then using personalization dialog by choosing Ctrl and secondary mouse button to personalize is not showing.  Iu2019m currently on EP7 SP15 and using iView type Web Dynpro Java for the development component sap.com/tcsecumewdenduser application name LogonHelpApp.  
    Any help is very much appreciated.
    Many Thanks,
    Gary

    Hello Michael,
    Yes, the Web Dynpro  for Java Personalization is working perfect for non-anonymous users.  The issue is when I view same iView using anonymous URL http://<servername>:<port>/irj/portal/anonymous the personalization is not showing just defaults back to the original Web Dynpro Java application settings.  The iView that I created and personalized is the new Logon Help Dynpro Java application (LogonHelpApp).  Is there some permissions that restricts anonymous user to view personalization?
    Koti Reddy Iu2019m using the Web Dynpro for Java Administrator Personalization.  Here is the documentation [http://help.sap.com/saphelp_nw70/helpdata/en/42/ed3ce7f8593eebe10000000a1553f7/frameset.htm |http://help.sap.com/saphelp_nw70/helpdata/en/42/ed3ce7f8593eebe10000000a1553f7/frameset.htm ]
    Thank You for your help,
    Gary

  • Create external window in Web Dynpro Java

    Hello experts,
    I am new in web dypro java as well as enterprise portal. I have a problem concerning external window.
    I have created a button in my ivew in web dynpro java. By a click on this button, I would like to open an external window with a specified URL(ex: www.google.com).
    Could you help me how to do it please?
    Thanks in advance,
    Sengly

    Hi experts,
    I have found the solution. Thanks to this link and thanks to all:
    [Problem with linkToURL in a table column|Problem with LinkToURL in a table column;
    best,
    Sengly

  • Kill the RFC connection as soon as the call is completed in Web Dynpro JAVA

    Hi Experts,
    Please guide us how to kill the RFC Connection from web dynpro java as soon as the execution is completed.The FM connection (Adaptive RFC) isnt getting closed in IS-U side. Please guide us how to close them explicitly.
    We are getting the following error
    (102) RFC_ERROR_COMMUNICATION max number of cpic clients exceeded (300)

    hi suvankar ,
    wdContext.current<Modelname>_InputElement().modelObject().modelInstance().disconnectIfAlive();
    use this option after executing your rfc, it will remove the connection to the r/3.
    adn this
    (102) RFC_ERROR_COMMUNICATION max number of cpic clients exceeded (300)  -- is occuring because the pool size defined the jco destination is not sufficient, ask your basis team to increase the pool size.
    Regards
    Govardan

  • HTTP form post from Web Dynpro Java Application without opening new window

    Hi Experts,
    We are trying to submit form data to an external URL from Web Dynpro Java application. We are achieving this with the following piece of code.
      try
       strPrintContent="<html>"+
         "<head>"+
         "<script type=\"text/javascript\">"+   
         "function myfunc () "+
         "{"+
         "var frm = document.getElementById(\"paymentForm\");"+
         "frm.submit();"+
         "}"+
         "</script>"+
         "</head>"+
         "<body onLoad=myfunc()>"+
         "<form id=paymentForm  method=post action=\""+merchantURLPart+"\">"+
         "<INPUT type=hidden name=username value="+userName+">"+
         "<INPUT type=hidden name=pass value="+passWord+">"+
         "<INPUT type=hidden name=senderid value="+senderID+">"+    
         "<INPUT type=hidden name=dest_mobileno value="+mobile+">"+
         "<INPUT type=hidden name=message value='"+msg+"'>"+
         "<INPUT type=hidden name=response value="+response+">"+
         "</form>"+
         "</body>"+
         "</html>";    
      IWDWebResource webResource = WDWebResource.getWebResource(strPrintContent.getBytes(),WDWebResourceType.HTML);
      IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(webResource.getAbsoluteURL(),"WBSEDCL");
      window.show();
      catch(Exception e)
      wdComponentAPI.getMessageManager().reportException("Error : "+e.toString(),false);
    But it opens another window. We dont need that. We have to stay on the same window.  Please suggest what can be done.

    Hi,
    You can create a HTML file with the request post parameters and the external URL something like this:
    public java.lang.String GetRedirecturl( )
    // External URL
    String html = "<html><head></head><body onload=\"load()\"> " +
    "<form id=\"form1\" action=\"https://www.abc.com/xyz.jsp\" method=\"POST\">" +
    // Post Parameters
    "<INPUT TYPE=\"HIDDEN\" NAME=\"Param1\"VALUE=\""+Param1Value+"\">"+
    "<input name=\"sap-wd-resumeurl\" type=\"hidden\"/>" +
    "</form> " +
    "" +
    "<script>" +
    "function load(){" +
    "var loc = window.location.search.substring(1);" +
    "var queryString = loc.split(\"sap-wd-resumeurl=\");" +
    "if(queryString.length > 0)" +
    "{" +
    "var resumeURL = queryString[1].split(\"&\");" +
    "if(resumeURL.length >= 0)" +
    "{" +
    " document.forms['form1'].elements['sap-wd-resumeurl'].value= unescape(resumeURL[0])" +
    "}" +
    "}" +
    "document.getElementById('form1').submit();" +
    "}" +
    "</script>" +
    "</body> </html>";
    String redirectUrl = "";
    byte[] byteArrayHtmlData = null;
    try {
      byteArrayHtmlData = html.getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
      wdComponentAPI.getMessageManager().reportException("Internal error occurred. Please try after some time",true);
    IWDResource htmlResource = WDResourceFactory.createCachedResource(new ByteArrayInputStream(byteArrayHtmlData), "Redirect.html", WDWebResourceType.HTML, true);
    redirectUrl = htmlResource.getUrl(WDFileDownloadBehaviour.AUTO.ordinal());
    return redirectUrl;
    Hope this will be helpful.
    Regards,
    Anurag

  • File Visibility in uploading the file using web DynPro java

    hello,
    i have gone through the tutorial " uploading & downloading the file using web DynPro java".
    the upload functionalty is working fine. but i need to know thw path where these files are getting uploaded ??
    Waiting for the reply..
    Regards,
    Viren Gupta

    Hi Viren,
    Are you are refering to the below tutorial for upload and download:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0e10426-77ca-2910-7eb5-d7d8982cb83f?QuickLink=index&overridelayout=true
    If yes, then answer is that the file is stored in the context of the application only as "com.sap.ide.webdynpro.uielement-definitions.Resource" object. Please read through the tutorial to understand the full process.
    WD doesn't really upload to server automatically unless there is any explicit code written. All it does is to store the file in a temp context which you can access and write your own code to store it in a particular location.
    Regards,
    Mahesh

  • How to clear sessions in java while closing the window

    Dear all,
    When I am closing the window if I click 'x' on window how to handle that event in java script , or any other way for this event handling.
    Sudheendra.

    Thank you very much ,
    In my application for each login i am using different sessions.
    In one login if a user navigating then there is no chance of opening different windows.
    So when the user without clicking logout button , if he closes the window by clicking 'x' , then the session allocated for this login is retaining until the session time out.
    so i want to invalidate the session for this particular login .
    Thank you,
    Sudheendra.

  • Problem in completing the TASK when using Web Dynpro Java and BPM

    Hi,
    I am using Web Dynpro Java and BPM.
    i see my Web Dynpro View when i run the process.
    Just that the task is not completing.
    when i click on the Web Dynpro button to signal the completion of the event, nothing happens.
    i have appropriately created events in both Component controller and Interface Controller and used the same in creating the Task.
    a method in Component controller fires the event and a button click in the view calls this method.
    i have successfully completed Donka Dimitrova's "SAP Netweaver Business Process Management-End-to-End Process Implementation Sample " but when i tried my own with slight modifications, it is not working !!!
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/d07f3e88-554f-2b10-3cbf-ab8afea51b9f
    regards,
    -Amol Gupta

    Hi Amol,
    The way you described the things, I dont see any problems. Just to make sure that you are triggering the right event that you mapped as completion event for the task, try to cross check once again and see if the correct event is getting triggered. Also try to put some messages for debugging to see till where the control goes.
    Regards,
    Arafat

  • Standard F4 (search help) in the web dynpro JAVA

    Hi,
             I have a small doubt in web dynpro Java. Basically I am an ABAP developer. We created some custom Remote function modules (RFM). Now are able to call RFM through web dynpro JAVA in the portal. We are able to run the RFMs in the portal.
             But we have problem with search help. How can I built the search help for the input fields in the portal using web Dynpro  Java.
             Can we bring standard search help (which is exist in R/3) in the portal?

    Hi,
    I think there is no standered functionality available in WDJava to achieve this functionality like ABAP or WDAbap. but, you can still achieve this using OVS option. to do this also, first you should have an interface which can talk to the R3 system and search the dB as per the query parameters i.e, an RFC which can the desired form of input and give you the desired output.
    for more info on OVS, please look into this below links.
    OVS:
    Web Dynpro Java Tutorials and Samples NW 2004 [original link is broken]#51 [original link is broken]
    WDJ tutorials:
    Web Dynpro Java Tutorials and Samples NW 2004 [original link is broken]

  • Reg: Closing and Opening Web Dynpro Application in same browser

    Dear Experts
    In my webdynpro application when i click a button another web dynpro application is opened in another window(another browser) .
    But i want to open the second web dynpro application inside the same browser in which closing the first applicaiton and opening the second web application in same browser window .
    Please guide me to do this.
    Regards
    Arun

    hi ,
    Exit plugs have the special property that they use the defined URL parameter. After you have created the URL parameter in the parameter list on the Outbound Plugs tab page in the window editor, you can specify a value for this parameter in the method that calls the exit plug.
    ref
    link:[http://help.sap.com/saphelp_nw70ehp1/helpdata/en/48/ca3351508f04e7e10000000a42189c/content.htm]
    it would help u
    regards,
    amit

  • How to set a variable in portal session using web dynpro java.

    Hi,
    I have created a web dynpro application, which is running inside portal. I have created a role called "R1". Inside role R1, i have created 3 workset W1, W2 and W3. and inside each workset i have some pages and iviews.
    My requirement is when user logins to the portal , and when he clicks on role R1 for the first time, a login page should come (so that we can do revalidation), and when he enters his password again in that login page , then only workset W1, W2 and W3 should be visible/accessible to him and after successful revalidation, if he clicks again on role R1, in that particular portal session, than that login page should not come.
    for this, i thought i will set a variable in portal session, whenever user successfully revalidated himself, and if after successful revalidation he clicks again on role R1, i will check in doinit method of webdynpro whether variable is set or not (which i already set on successful revalidation), and if it is set then i will do Donavigation else i will present login page to the user.
    Can anyone tells me how to set a variable in portal session using web dynpro java.
    thanks
    Arush

    Hi,
    Try this:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE, key, value)
    WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE, key)
    Ex:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE,"Key1","Value1");
    String value1=WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE,"Key1").toString();
    /people/william.cui/blog/2007/02/12/sharing-session-context-between-parent-and-external-windows-running-on-same-host
    Regards,
    Charan

  • Deploying my first web dynpro java application through NWDS 7.3 giving error

    hi all,
    i am new to webdynpro java. i am basically a xi consultant, but due to some work need to work on webdynpro java as well.
    i went through the blog Web Dynpro Tutorial: Hello World
    i am using NWDS 7.3
    i created web dynpro project as per above blog. on the last step, it says to deploy it on SAP system.
    now i have access to PI7.1 system only, though in our landscape, we have ECC system, EP system, BI system etc.
    i guess the above webpage is referring to getting it deployed on EP system - but i have access to only PI7.1 system - in NWDS 7.3 in window - preferences - SAP AS Java - i have added PI7.1 system and it is showing there.
    now on right-clicking web dynpro application, and selecting deploy new archive and run - it is not deploying and the web-page gives error 404 - not found. The requested resource does not exist.
    can the web dynpro application be deployed on PI7.1 system?
    pls suggest how to resolve this error. thanks.

    i have downloaded NWDS7.1 through this link
    https://nwds.sap.com/swdc/downloads/updates/netweaver/nwds/ce/
    used the first option - Download latest NWDS_platform.zip release
    the zip file got downloaded.
    on trying to install through IDEsetup.exe - now i am getting error in installation - The installer cannot run in the 32-bit sub-system on a 64-bit architecture.
    how to solve this error - i tried installing jdk-6u7-windows-x64.exe and jdk-6u18-windows-x64.exe - but still the error remains same.
    So how to install NWDS7.1 on my system? please tell. thanks.

  • Accessing ABAP Functions in Web Dynpro Java

    Hi,
    I am trynig to do "Accessing ABAP Functions in Web Dynpro Java" this application, (which is the example application which i got from www.sdn.sap.com) but everything is fine no error also while dyploying.
    But it is not dysplaying the first page after i run the application i am getting plain web page ,without any content.
    Can any body help me.
    Regards,
    H.V.Swathi

    k.. now iam getting some error on page.
    I have embeded the two view in to window.
    But now after running the application i am getting connection error
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to message server host failed Connect_PM TYPE=B MSHOST=jktr3 GROUP=SPACE R3NAME=R32 MSSERV=sapmsR32 PCS=1 ERROR Group SPACE not found TIME Fri Sep 26 15:05:59 2008 RELEASE 700 COMPONENT LG VERSION 5 RC -6 MODULE lgxx.c LINE 4288 DETAIL LgIGroupX COUNTER 1
        at com.sap.mw.jco.MiddlewareJRfc.generateJCoException(MiddlewareJRfc.java:457)
        at com.sap.mw.jco.MiddlewareJRfc$Client.connect(MiddlewareJRfc.java:989)
        at com.sap.mw.jco.JCO$Client.connect(JCO.java:3193)
        at com.sap.dictionary.runtime.mdi.DataProvider.<init>(DataProvider.java:90)
        at com.sap.dictionary.runtime.mdi.DataProvider.<init>(DataProvider.java:122)
        ... 61 more
    Rgards,
    H.V.Swathi

  • KM Permissions in Web Dynpro Java

    The error message: "Permission denied: uri=/kmfolder,
    permission=node_create_child, user=XXXXXX"
    Background:
    We are using a KM Windows repository to connect KM to a Windows shared
    folder over the network. Then we are using a Web Dynpro java
    application to write a file to the KM Folder, which is then mapped to
    that KM Windows repository.
    Security on the Windows shared folder is wide open. Everyone=Full
    Control, and Domain Users=Full control.
    Problem:
    When end users try to write the file to KM through the Web Dynpro app,
    they get the error:
    "Permission denied: uri=/kmfolder, permission=node_create_child,
    user=XXXXXX"
    But when we give them the Content Admin role, they are able to write
    the file just fine. For this reason, I do not believe there is a
    Windows permission issue.
    We have tried:
    -Explicitly setting User Mapping through User Admin -> Identity
    Management
    -Using a System Principle role with Full Access (Read, write, delete)
    -Duplicating the Content Admin role, removing the pages & iViews (so
    they can't view the Content Admin interface) and assigning this role to
    our test users.
    We have setup:
    Network path
    - ->jCIFS=True
    - ->Network path=
    <serv.host.com>\<sharename>
    - ->User=<domain>\<ADMIN User>
    KM Windows System Object
    - ->User Mapping=admin,user
    KM Windows System Landscape Definition
    CM Repository Manager
    - ->Prefix=/<sharename>
    - ->Persistance Mode=fsdb
    - ->Root directory=
    <serv.host.com>\<sharename>\root
    - ->Root directory for versions=
    <serv.host.com>\<sharename>\versions
    - ->Repository services=svc_acl
    - ->Security Manager=W2kSecurityManager
    - ->ACL Manager Cache=ca_rsrc_acl
    Edited by: Peter Speers on Apr 9, 2009 11:41 PM

    /thread/1302951 [original link is broken]

  • Display sapscript form in Web Dynpro Java

    Hi,
    Is it possible to print an existing sapscript form i.e. PO from ECC to my Web Dynpro application? I have successfully created a Web Dynpro Java application to create POs but now have a requirement to display or print the PO?
    Can someone provide me with a sample code? I'm hoping to be able to do this without using Adobe.
    Again, thanks for all your help.
    Best regards,
    Jaypee

    Hi mark,
    Without Adobe also u can display PO order.
    Below is the code to open a HTML window from WDJava, with data from WDJava...
    Inside DoInit()
    IWDAttributeInfo attr1 =
    wdContext.getNodeInfo().getAttribute("htmlfile");
    ISimpleTypeModifiable mtype1 = attr1.getModifiableSimpleType();
    IWDModifiableBinaryType btype1 = (IWDModifiableBinaryType) mtype1;
    btype.setFileName(attr.getName() + ".html");
    btype.setMimeType(WDWebResourceType.HTML);
    _contentType = mtype;
    Where htmlfile is a context attribute of type binary... and do a global declaration like this
    ISimpleTypeModifiable _contentType = null; (This declaration can be done at the end of your view's coding between Begin Others and End Others)
    Now,
    inside on action print
    public void onActionPrintData(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String videoName )
    //@@begin onActiondisplayVideo(ServerEvent)
    byte[] content = new byte4028;
    try {
    content = this.displayPrint().getBytes("UTF-8");
    wdContext.currentContextElement().setHtmlfile(content);
    wdContext.currentPrintElement().setAttrUrl(
    _contentType.format(content));
    //Where content is loaded with data from displayPrint() method, which is holding the HTML *page to be displayed to the user *
    IWDWindow win =
    wdThis
    .wdGetAPI()
    .getComponent()
    .getWindowManager()
    .createNonModalExternalWindow(WDWebResource
    .getWebResource(content, WDWebResourceType.HTML)
    .getURL(),"ShowVideo");
    win.setWindowSize(445,460);
    win.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
    win.removeWindowFeature(WDWindowFeature.TOOL_BAR);
    win.removeWindowFeature(WDWindowFeature.MENU_BAR);
    //win.open();
    win.show();
    // wdComponentAPI.getMessageManager().reportSuccess("444444444444");
    } catch (Exception e) {
    wdComponentAPI.getMessageManager().reportException ("Unable to open window"+e,false);
    //@@end
    Now finally, design your HTML Page inside the method displayPrint() like this
    public java.lang.String displayPrint( java.lang.String strVideoName )
    //@@begin displayPrint()
    String htmlcontent=null;
    htmlcontent="content what you want to show in print window";
    use script inside the html content to do a print... like window.print();
    return htmlcontent;
    //@@end
    Regards,
    Sunaina Reddy T

Maybe you are looking for

  • I work a long list. Each line has a link that I click on to work. I then click submit. It does not return to the last line worked. Goes to the begining.

    I go to the Insurance Auto Auction website to access a list of vehicles up for auction. When using "explorer" I can follow the link and set a bid value then click submit. It will return me to the last position on one the list. Firefox will sometimes

  • XI Performence issue

    Hi, All we have IDOC ->JDBC Scenario we need to send 3,50,000 IDOC Data to JDBC Tabel ,Data(3,50,000) Reached to XI ,From XI to Insert in to Tables It is Taking time. Per minit XI Is Processing 50 Records,It will Take lot of time to process all Recor

  • BAPI or FM for FCH6.

    Hi Team, Is there any Function module for FCH6.I want to update Company code,House bank Id,Account ID, Check Number,and Encashment Date.Please help me. Thanks and Regards, Shakeer

  • Press play and the songs don't play

    I press play on my ipod and the song comes up but it doesn't start. I have tried different songs. I only had the ipod since Xmas.

  • Backing up password protected folders

    I want to use the instructions in this link to create an encrypted disc image on an external hard drive so that one folder with important files is password protected.  I've never done this before. Two questions: 1)  Is there a more current or better