cancel
Showing results for 
Search instead for 
Did you mean: 

splitapp - issues

Former Member
0 Kudos

splitapp - how to hide master when I click on the event in master, I am rendering information in the detail page.

I am using all the different modes like popup, hide mode or showhide mode, but the master is not hiding after rendering details in the detail page.

should we do it explicitly?

Accepted Solutions (1)

Accepted Solutions (1)

kedarT
Active Contributor
0 Kudos

Hi Suhaas,

How about using hideMaster on your splitapp, more info - SAPUI5 SDK - Demo Kit

Hope this helps

Former Member
0 Kudos

Hi Tingikar,

I am using the below code as per your suggestion, its working perfectly in Win7 Desktop -> Chrome Browser for normal URL.


splitapp.setMode(sap.m.SplitAppMode.HideMode)

splitapp.hideMaster();


but, this is not working for fakeOS mode in the URL, when I am testing in Mobile as well as in Win 7 -> Chrome with fakeOS = android.


sap-ui-xx-fakeOS=android.

Answers (4)

Answers (4)

maheshgonda
Product and Topic Expert
Product and Topic Expert
0 Kudos

hi ,

Master list will be automatically hidden in mobiles so no need of writing any extra logic , but not in desktop and tablets. So first write code to detect devices (desktop , tablet or mobiles) then write logic which will hide and show masterlist .

go through this discussion

SAPUI5: What is the best Reliable way to detect... | SCN

juancarlosorta
Participant
0 Kudos

Can you try this?

var myApp = new sap.m.SplitApp({
  mode
: sap.m.SplitAppMode.ShowHideMode,
  beforeMasterOpen
: function() {
  
this.setMode(sap.m.SplitAppMode.ShowHideMode);
 
},
});

masterClicked
: function(oControlEvent) {
     myApp
.toDetail("your.View");
     myApp
.setMode(sap.m.SplitAppMode.HideMode);
}


or

this.app = new sap.m.SplitApp("myAppID",{

         afterDetailNavigate: function() {

               if (sap.ui.Device.system.phone) {

                     this.hideMaster();

               }

         },

});

You can simulate android app by passing the fakeOs parameter in the url,

http://<path>/index.html/?sap-ui-xx-fakeOs=android .


Best regards

juancarlosorta
Participant
0 Kudos

Hi Suhaas, This piece of code toggles between hiding and showing the view.

(in your event or wherever you want to hide the master)

app = sap.ui.getCore().byId("id_app");

if(app.getMode() == "ShowHideMode"){

     app.setMode(sap.m.SplitAppMode.HideMode);

}

else{

      app.setMode(sap.m.SplitAppMode.ShowHideMode);

}

Regards

Former Member
0 Kudos

Hi Carlos,

This is working half and half.. in the desktop browser.

But, it is not working in mobile URL with sap-ui-xx-fakeOS=android.

draschke
Active Contributor
0 Kudos
if (app.getMode() === "ShowHideMode") {
app.setMode(sap.m.SplitAppMode.HideMode);
} else {
app.setMode(sap.m.SplitAppMode.ShowHideMode);
app.setMode(sap.m.SplitAppMode.HideMode);

}

I had to use this, that Master was hiding each time.

jamie_cawley
Advisor
Advisor
0 Kudos

Try using

splitapp.setMode(sap.m.SplitAppMode.HideMode)

Regards,

Jamie

SAP - Technology RIG

Former Member
0 Kudos

some how master is still not hiding when I set above line after the master (list) action is clicked and details are displayed.

jamie_cawley
Advisor
Advisor
0 Kudos

Are you sure you correctly set the value of splitapp prior to adding the code in?

regards,

Jamie

SAP - Technology RIG