cancel
Showing results for 
Search instead for 
Did you mean: 

Different behaviour Business Application Studio vs SAP BTP HTML5-Application with Fragments

JulT
Explorer
0 Kudos

Hi all, 

I'm a Javascript-Noob but need some of it for my Fiori Elements Enhancements. 

I built an App where I want to have a Custom Action. Within this action I'm calling an API to fetch values and then calling a fragment I built with XML. Inside the Fragment the values fetched will be visible in a dropdown. On Business Application Studio everything is working. My Fragmentis opening without problems and my data is presented there. 

Then I deployed the App to our BTP as an HTML5-Application (via MTA). The App is opening and everything works beside the Fragment. My coding looks like this (instead of debugger I'm doing some things, but in the end I'm opening the Fragment via the open()-Method.

 

var QueryTaskCodes = jQuery.ajax
    ({
        type: "GET",
        contentType: "application/json",
        url: URLTaskCodes,
        dataType: "json",
        success: function (data) {
            if (!that.pDialogCloseCreateNotification) {
                that.loadFragment({
                    id: "CreateAndClose",
                    name: "some.app.ext.fragment.CreateAndClose",
                    type: "XML",
                    controller: that //this
                    }).then((oDialog) => {
                        debugger;
                        that.pDialogCloseCreateNotification = oDialog;
                        that.pDialogCloseCreateNotification.open();
                        });
    }}})

 

 Within the Busines Application Studio Preview the debugger shows, that oDialog is set.

JulT_0-1711456754254.png

However, on BTP HTML5-App it's undefined. 

JulT_1-1711456805755.png

What am I missing? What am I doing wrong?

Best wishes,

Julian

 

Accepted Solutions (0)

Answers (1)

Answers (1)

JulT
Explorer
0 Kudos

Aah, seems I had used a deprecated function for my Fiori Version. BAS seems to be a little bit more relaxed on this topic than BTP 😄 

 

I changed 

that.loadFragment({

to

Fragment.load({

Now it's opening the Fragment in my App.