Skip to Content

How to hide masterpage in splitapp in SAPUI5

Hai Experts,

I am developing one splittapp application using SAP WEBIDE. Now I want to hide the master page when If am pressing any button event. My views are injected in splitapp by the routes in manifest.json file of the Component.js.

Please help me to resolve the above issue.

Thanks in Advance.

Thanks,

Muhsin

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 14, 2017 at 11:19 AM

    Hi Muhsin,

    You won't be able to fetch the splitapp object using this code: var oSplitapp = sap.ui.getCore().byId("idAppControl"); because the id "idAppControl" is a relative id for the view, so you can't use the Core with this id. You can do as below:

    1. Go to the controller of App.view.xml (this is the view containing your SplitApp control)

    2. Write below code inside onInit method:

    this.getOwnerComponent()._oSplitApp = this.byId("idAppControl");

    3. Now you can to either your Master or Detail controller and use below code to get the SplitApp object.

    var oSplitApp=this.getOwnerComponent()._oSplitApp;

    4. Now you can use below method for hiding master:

    oSplitApp.hideMaster();

    Note: Your Split App mode should be set to "HideMode" for hiding master page.

    <SplitApp id="idAppControl" mode="HideMode" />

    Regards,

    Rahul

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 14, 2017 at 08:29 AM

    Hi Musin,

    In sap.m.Splitapp you have property called mode="ShowHide"

    Please open below link and try with different modes.

    https://sapui5.hana.ondemand.com/1.32.7/docs/api/symbols/sap.m.SplitAppMode.html

    Regards,

    Shekar

    Add comment
    10|10000 characters needed characters exceeded