cancel
Showing results for 
Search instead for 
Did you mean: 

SplitApp - Remove the master view by hiding its nav container...

Former Member
0 Kudos

Hi,

According to a parameter in the URL I want to completely remove the Master view from the SplitApp control so it looks like an App.

I managed to do it with the debugger pop-up (CTRL+****+ALT+S) by disabling the Nav Container of the Master view so the Master view disappears and the details view takes all the space freed by the Master view.

The question is how to retrieve the Nav container as it is not present in the XML view and I cannot fix the Id to get it to hide it.

Regards,

Serge.

Accepted Solutions (1)

Accepted Solutions (1)

saivellanki
Active Contributor
0 Kudos

Hi Serge,


Is this what you are expecting? http://embed.plnkr.co/2QtUUBfs4pJMLO0vRNX3/preview


Regards,

Sai Vellanki.

Former Member
0 Kudos

Hi Sai,

Thanks for your answer!

The idea is to have a UI5 control in the XML view and fix its ID so we can retrieve it with the 'byID()' at controller side.

Regards,

Serge.

former_member182372
Active Contributor
0 Kudos

SplitApp is a regular control, you can specify id explicetly for it, what`s the problem?

Former Member
0 Kudos

Hi Maksim,

The issue is that in the Control Tree I have a SplitApp control which contains two navigation components (one for the master and one of the detail.)

This is my XML view:

<SplitApp id="idAppControl">

    <masterPages id="idMaster"/>

    <detailPages id="idDetail"/>

</SplitApp>

An from my controller I try to get the master navigation with the idMaster to make it invisible .

So far no success!

Regards,

Serge.

former_member182372
Active Contributor
0 Kudos

masterPages is an aggregation not control

you can try

byId("idAppControl").destroyAggregation("masterPages", true);

saivellanki
Active Contributor
0 Kudos

Hi Serge,

You cannot set the id for masterPages, since it is an aggregation of SplitApp.

I have re-build the logic to make it look better, check this -


XML View -


  <SplitApp id="oSplitApp">

  <masterPages>

  <Page title="Master1" />

  </masterPages>

    <detailPages>

  <Page title="Detail1">

  <content>

  <Button text="Toggle" type="Emphasized" press="onPress" />

  </content>

  </Page>

  </detailPages>

  </SplitApp>

onPress button Logic -


onPress: function(oEvent){

var oSplitApp = this.getView().byId("oSplitApp");     //Get Control of SplitApp

var oMasterNavContainer = oSplitApp.getAggregation("_navMaster");     //Get Hold of Master NavContainer

oMasterNavContainer.setVisible(!oMasterNavContainer.getVisible());

}   

For Master Pages id, you can do oSplitApp.getAggregation('_navMaster').getId();

Please check the sample here - http://embed.plnkr.co/WD2WTrvS6SplGRf9kd1M/preview

Regards,

Sai Vellanki.

Former Member
0 Kudos

Hi,

Thanks a lot for this code but the issue is that the views are injected in the SplitApp by the routes in the manifest.json file of the Component.js.

You put the code in a button's event when the views are already rendered but I'd like to do it before the they appear in the split app.

Thanks for your help!

Cheers,

Serge.

saivellanki
Active Contributor
0 Kudos

Serge,


I am not sure whether you can get hold of split app ID before the split app view load.

How about using the press event logic in onAfterRendering lifecycle method of split app view, so by the time view loads your master will be hidden something like this -


onAfterRendering: function(oEvent){

  var oSplitApp = this.getView().byId("oSplitApp");

  var oMasterNav = oSplitApp.getAggregation("_navMaster");

  oMasterNav.setVisible(false);

}

Check this sample - http://embed.plnkr.co/vwBTjNQFY2O811mvCTk9/preview

Regards,

Sai Vellanki.

Answers (0)