cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Include one app in another?

dominik_auras
Participant
0 Likes
338

Hi,

is it possible to include one app in another app?

The problem is:

I want to display details of an entity (with dynamic display of its attributes) in different kind of ways.

One time standalone.

One time in an approval task.

One time in an approval task displayed after selected in a list.

One time in an approval process.

And maybe some other scenarios....

So in the end I don't want to build (and maintain!) my dynamic app multiple times!

Is there any example or solution for something like this?

Thanks and kind regards,

Dominik

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
SAP Champion
SAP Champion
0 Likes

do you know how to use component?

dominik_auras
Participant
0 Likes

no....?

junwu
SAP Champion
SAP Champion
0 Likes

SAPUI5 SDK - Demo Kit

I think you have seen a lot

sap.ui.getCore().attachInit(function () {
  
new sap.ui.core.ComponentContainer({
  name
: "sap.ui.demo.wt"
  
}).placeAt("content");

  
});


component(like in web dynpro) is the reusable unit. in the component you can return your view in method createcontent. any place you want to put your view, just use that code(new a component)

dominik_auras
Participant
0 Likes

Okay, thank you.

But how do I have to refer to an other application/component?

Will he find the application by name!?

.... If I give the ComponentContainer a name of an application I got an error like:

Uncaught Error: resource zv/research/embed/view/View1.view.xml could not be loaded from ./view/View1.view.xml. Check for 'file not found' or parse errors.

junwu
SAP Champion
SAP Champion
0 Likes

var oComp = sap.ui.getCore().createComponent( {

  name : "yourcomponentname",//example : sap.demo.wt

  id : "Comp3",

  url : "url of the application to be integrated"// example: /sap.com~yourapp~****/

  });

  var oCompCont = new sap.ui.core.ComponentContainer("CompCont3", {

  component : oComp

  });

dominik_auras
Participant
0 Likes

Uncaught Error: failed to load 'zv/application/dummy02/Component.js' from ../../resources/zv/application/dummy02/Component.js: 404 - Not Found

I think I am near ... but it seems the component I want to embed is not known....

junwu
SAP Champion
SAP Champion
0 Likes

can you show me the code?

dominik_auras
Participant
0 Likes

sap.ui.define([

  "sap/ui/core/mvc/Controller"

], function(Controller) {

  "use strict";

  return Controller.extend("zv.research.embed.controller.View1", {

  // Called by Button

  onTest: function(){

  var oCompCont = new sap.ui.core.ComponentContainer("CompCont", {

  name: "zv.application.dummy02"

  // url: "/zv/application/dummy02"

  });

  oCompCont.placeAt("__xmlview0--myContent");

  }

  });

});

My View-Controller.


<mvc:View controllerName="zv.research.embed.controller.View1" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc"

  xmlns="sap.m">

  <App>

  <pages>

  <Page title="{i18n>title}" id="myContent">

  <content>

  <Text text="zv.research.embed - View1"></Text>

  <Button text="Do something special!" press="onTest"></Button>

  </content>

  </Page>

  </pages>

  </App>

</mvc:View>

My View.

For more information:

I am testing in Web IDE.

zv.application.dummy02 is a application in my Web IDE.

I want to embed it in my view.

junwu
SAP Champion
SAP Champion
0 Likes

in the component, did you return the view?

junwu
SAP Champion
SAP Champion
0 Likes

/resources/zv/application/dummy02/Component.js  is this one pointing to your component?

dominik_auras
Participant
0 Likes

No ... I didn't know that I have to.

In general I think that first there is another problem, that the component couldn't be found as there is an 404 error ....

Isn't there any example for including Components/Applications in an Application out there.....?!

dominik_auras
Participant
0 Likes

It seems not ...

.....hanatrial.ondemand.com/resources/zv/application/dummy02/Component.js

Leads to: HTTP Status 503 ...

junwu
SAP Champion
SAP Champion
0 Likes

try in  your lcaol eclipse&tomcat

dominik_auras
Participant
0 Likes

I don't use eclipse and tomcat!

I think it must also be possible in SAP Web IDE!