Let's follow up this discussion at the Neptune Community

(this forum will be kept in read-only mode)

Start App from a other App

Hello,


how can i start a App from a other App and go back to the first App on the same Place as i start ?

I start all App in Cache Mode.





Thomas



Hi Ole Andre!


Thank you for the info! Also I've added <scrip> link in <body> I'm still getting error message "... is not a function"/undefined.


I'm calling second app from Phonegap, maybe I should set/change some security settings?


Hi


All declarations in the Header part will not be part of the AppCache.Load method. Only the content in the body section, wrapped into a UI5 JSView.


If you need to declare other libraries, you can do it with a script tag inside the app.


Example loading Google API:


 

loadGoogle();

function loadGoogle()
{

    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyClGtQTLN9rj__p_2S-HTZ9fAcjC3a22w8&callback=initGoogle';
    document.body.appendChild(script);
}

function initGoogle()
{

}

 

Regards

Ole Andre 

It looks like 3rd party js files I declare in 2nd app Header section are not called when 2nd app is called from another app. 
How can I fix this?

Hi,

one additional Thing:

The element was not added to the view, just declared. If i Change this, the Navigation works.


Regards

Armin

OK...

I managed to get the AppCache loaded at Desktop Environment to investigate and the Navigation back from the second (stateless) app to the first (stateful) app leads to the following error:

"Error: adding element with duplicate id 'oMAnfDetPos'"

The element is from the first app and does not Show up in the second app...


Regards

Armin

Hi Armin


In NAM, go-to your Bundle App and press Run from the Footer. You will now be able to run the App in your browser and check for errors.


For documentation, please check this:

https://template.neptune-software.com/neptune/sdk/explored#doc00163EDC99661ED4B3936685DEE6ACBB


Regards

Ole Andre 


Hi Ole Andre,

in Chrome (PC) i can not navigate to another app at all since i get "AppCache is not defined".


Is there any Information available about how to create a role based item ?


Regards

Armin 

Hi Armin


I tried by changing our menu app to stateful, and it works fine with the navigation. 


If you have more than one App you will provide your users, we do recommend using our role based menu. You will then have the option to assign policy to different tiles based on the users roles in SAP. And thus making the menu dynamically showing the apps the user have access to.


If you open the developer console in chrome (F12), do you get any errors ? 


Regards

Ole Andre 

Hi Ole Andre,

i have my own stateful StartApp and i navigate to a second stateless App. If i navigate back (AppCache.Load(AppCache.StartApp) ;-) or AppCache.Back()), the Neptune Client hangs.

I have not fully configured the role based menu stuff in NAM (since it worked with 2 stateless apps), is this mandatory ?

Regards

Armin

Hi Armin


It should work even if the second App is stateful. 


Are you using the default neptune_appcache_menu and enabled the "Use role based menu" in NAM ? (recommended) Or using your own StartApp and navigating to others from this one ?


PS: AppCache.Load(StartApp) -> AppCache.Load(AppCache.StartApp)


Regards

Ole Andre 




Hello,

is there any chance that it works if the first app is a stateful app ?

I created a bündle app, the Navigation to the second app works fine but neither AppCache.Back() nor AppCache.Load(StartApp) work. Everything works fine if the first app is stateless.


Regards,

Armin 


Hi Michael


You need to use a Bundle App as the start App when using AppCache methods. For desktop Apps, you only need to mark the Web App in the Bundle App and you can click on Run to use AppCache environment. The best part using AppCache on desktop is to avoid loading UI5 libraries for each App you would like to navigate to.


Another way is to use the URLHelper and redirect to the next App. The example will check if AppCache is loaded and navigate to the next App using URLHelper if AppCache is not present:


  

if (typeof AppCache == "undefined") {

    jQuery.sap.require("sap.m.URLHelper");

    // Link to new page
    // Use 2. parameter for new window or not
    sap.m.URLHelper.redirect("appname", false);

} else {

    AppCache.Load("appname");

}
 

 


Regards

Ole Andre 


1 person likes this

Hello,


when i say AppCache.Load("appname") it runs on iPad/iPhone and i come to the second app.


But it doesn't work when i use the Browser on the PC.

Can you say me what is wrong?


Thanks & Regards


Michael

The AppCache.Back(); are only available from NAD 3.0.


To be able to use AppCache please do:


- NAD 2.20 - Start AppCache Configuration and create a configuration -> preview

- NAD 3.0 - Start Neptune Application Management and create a bundle App -> Run


Using support package 3 of the 2.20 release of NAD AppCache.Back(); does not work any other way to call the previous app.


when executing in desktop even though i use AppCache.Load("appname"); unable to view the 2nd app.


Login or Signup to post a comment