Page Is Blank Without Throwing Any Errors

后端 未结 2 568

I am trying to display few tiles in a tile container which fetches data from a dummy JSON file. I have coded exactly shown in this sample. But my page appears empty. Also it

2条回答
  •  盖世英雄少女心
    2020-12-20 06:32

    Your root view is missing a root control such as sap.m.AppAPI which:

    • Writes a bunch of properties into the header of HTML document, e.g. the viewport meta tag,
    • Writes height: 100% to all its parent elements.[src]

    Without a root control, the content will be displayed improperly. Hence, adding an should be sufficient in your case:

    
    
       
        
      
    
    

    The reason why the linked sample is working, is that the control sap.m.App was already added in index.html. The samples shown in the Demo Kit, however, often miss index.html in the code page to be shown which can be confusing.


    Alternatively, without sap.m.App, you could also add the following in index.html and in the root view:

    1. Add 100% height to , and to

      if it exists.

      style="height: 100%;">
       
         
         
       
       
         
      style="height: 100%;" data-sap-ui-component data-height="100%" data-...>

    2. And in the root view:
      
        

    Example: https://embed.plnkr.co/6AJKC0

    This will make the content visible too but without the need to use sap.m.App in the root view.

提交回复
热议问题