Skip to Content
0

How to hide masterpage in splitapp in SAPUI5

Sep 14, 2017 at 06:24 AM

429

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

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

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

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Dear Rahul,

Its working fine..Thanks..:)

1

Hi Rahul,

The above code is perfectly working for me... Now they are asking another requirement. if we are clicking the menu button need to call one event..I have referred the same in API Reference, but no luck. Please help me to find out the same.

capture.png

Thanks,

Muhsin

capture.png (7.0 kB)
0
Former Member

Hi,

You can use one from the below events, whichever is suitable:

Below is the link for the same:

https://sapui5.hana.ondemand.com/1.44.14/#docs/api/symbols/sap.m.SplitContainer.html#constructo

capture.jpg (36.5 kB)
0
Mantri Shekar Sep 14, 2017 at 08:29 AM
0

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

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Dear Shekar,

Thanks for your immediate response.

I Tried the above method, But the below code is getting undefined in my console.

var oSplitapp = sap.ui.getCore().byId("idAppControl"); //splitapp Id

Please guide me how to get the control for splitapp.

Thanks,

Muhsin

0

Hi Muhsin,

Could you please show me the code snippet view where you defined SplitApp.

That would help us to guide you properly.

Regards,

Shekar.

0

Dear Shekar,

I have defined my splitapp in App.view and the views are coming from routes in Manifest.json file of the Component.js.

<mvc:View
	controllerName="controller.App"
	xmlns:mvc="sap.ui.core.mvc"
	displayBlock="true"
	busy="{appView>/busy}"
	busyIndicatorDelay="{appView>/delay}"
	xmlns="sap.m">
	<SplitApp id="idAppControl" />
</mvc:View>

Thanks,

Muhsin

0

Hi Muhsin,

Replace

<SplitApp id="idAppControl" />
with

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

Hope this would solve your purpose.

0