Skip to Content

Asynchronous Views

I´ve seen this link:

https://help.sap.com/saphelp_nw75/helpdata/de/4a/498e58cb511c6ce10000000a42189b/content.htm?frameset=/de/4c/15a333190b579ae10000000a15822b/frameset.htm¤t_toc=/de/44/789eeed62455cee10000000a1553f6/plain.htm&node_id=301&show_children=false

But im not able to add a view/application to an applicationcontainer. Any help? any code example?Documentation about this is really poor.

I suppose that is something like that....

IWDApplicationContainer appContainer = (IWDApplicationContainer) view.getElement("ApplicationContainer");

IWDApplicationHandle application; //How to get this????

appContainer.setApplication(application);

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 10, 2017 at 08:15 AM

    https://help.sap.com/doc/2f39047ed6b141cb83658041d2d4e029/7.5.7/en-US/CE/wdr/com.sap.wdr/index.html?com/sap/tc/webdynpro/progmodel/api/IWDApplicationEnvironment.html

    https://help.sap.com/doc/2f39047ed6b141cb83658041d2d4e029/7.5.7/en-US/CE/wdr/com.sap.wdr/com/sap/tc/webdynpro/progmodel/api/IWDApplicationHandle.html

    In wdDoModify of the «embedding» view:

    public void wdDoModifyView(com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
      {
        //@@begin wdDoModifyView
            if (firstTime) {
                  //acAsync is the id of the App Containter, given in the UI editor of the embedding UI
                  IWDApplicationContainer acAsync = (IWDApplicationContainer) view.getElement("acAsync"); 
                  IWDDeployableObject deployableObject = WDDeployableObject.getDeployableObject("vendor.tld/tc~wd~package~of~dc");
    
                  try {
                        // name of the embedded Application
                        WDDeployableObjectPart applicationPart = deployableObject.getApplication("AsyncApp");
    
                        IWDApplicationHandle appHandle = wdComponentAPI.getApplication().getApplicationEnvironment().createHandle(applicationPart);
                        acAsync.setApplication(appHandle);
    
                        WDCallExecutionMode executionMode = appHandle.start(null);
    
                  } catch (WDDeploymentException e) {
                        wdComponentAPI.getMessageManager().reportException("Error while loading AsyncApp");
                        e.printStackTrace();
                  }
            }
           
        //@@end
      }
    
    

    In wdDoInit of the «embedded» view, contained in the application loaded above («AsyncApp» in this example):

    public void wdDoInit()
      {
        //@@begin wdDoInit()
            IWDApplicationEnvironment appEnvironment = wdComponentAPI.getApplication().getApplicationEnvironment();
            appEnvironment.setFollowUpExecutionMode(WDActionExecutionMode.ASYNCHRONOUS);
            appEnvironment.setEstimatedTimeToUpdate(10000l);
            // Action created in the embedded view
            IWDAction loadAppDataAction = wdControllerAPI.getAction("LoadApplicationData");
            appEnvironment.registerFollowUpAction(loadAppDataAction, new Object [] {});
       //@@end
      }
    
    
    Add comment
    10|10000 characters needed characters exceeded