cancel
Showing results for 
Search instead for 
Did you mean: 

Only Title is Displayed.

former_member269453
Participant
0 Kudos

Dear All,

Today I was designing a Split App app using xml views, and I faced a very peculiar problem

I just created a new project "for mobile" and I added a sample button to the initial view. I used a component container

Below the sample code:

Index Html:

var compContainer = new sap.ui.core.ComponentContainer(

                     'rootComponentContainer', {

                          

                           name : "ss.testsplitN"

                     });

       compContainer.placeAt("content");

</script>

  1. Component.js

var oView = sap.ui.view({

            id: "idViewRoot",

            viewName: "ss.app.sublimesplitapp.testView",

           

            type: sap.ui.core.mvc.ViewType.XML

<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"

              controllerName="ss.app.sublimesplitapp.testView" xmlns:html="http://www.w3.org/1999/xhtml">

       <Page title="Title">

              <content>

       <Button text="PRESS" />

When I run this app on my local server only the page with TITLE is shown. No button is visible.

SO I debugged and inspected the html result code and figured out that i need to add an additional css style sheet.

Added :

<!-- <style type="text/css">

.sapMPage>section {

height: 100%;

}

and it works just fine

So I'm not able to understand this behavior. What mistake did I make? why isnt this the default property?

Thanks & Regards,

Dipankar

Accepted Solutions (1)

Accepted Solutions (1)

Qualiture
Active Contributor
0 Kudos

If you encapsulate your Page in an App then you don't need to set the height to 100%

former_member269453
Participant
0 Kudos

but i used a component conatiner.

Qualiture
Active Contributor
0 Kudos

You can replace the component container with an App, or add an App to the component container.

The reason the page doesn't show is that it's height is set to 100% of the encapsulating container. In your case, it is not set. App and SplitApp have them set to 100%, that's why it works with these containers

Former Member
0 Kudos

If you really want to use a ComponentContainer, then you must create another view, say App.view         ( root view ) which will either use sap.m.App or sap.m.SplitApp

1.App.view.js

  var oAppContainer = new sap.m.App();

 

  oAppContainer.addPage(oPage1);

 

Here page1 should be your your First Page to display

2. Component.js

var oView = sap.ui.view({ 

  id : "app", 

  viewName : "demo.App", 

  type : "JS", 

  }); 

return oView

former_member269453
Participant
0 Kudos

awesome Robin!!

Answers (4)

Answers (4)

flezana
Discoverer
0 Kudos

Will do. Thanks!

flezana
Discoverer
0 Kudos

Hi, anybody can help me with this?

Thanks.-

ChrisSolomon
Active Contributor
0 Kudos

You need to start your own , new thread/question on this. You added on to a post from 2015 so I would not expect much help there.

flezana
Discoverer
0 Kudos

This message was moderated.

Former Member
0 Kudos
So I'm not able to understand this behavior. What mistake did I make?

You may have to read that comment 

openui5/App.js at master · SAP/openui5 · GitHub