Sapphire SapUI5 not working

For some reason, the tilecontainer is not working. If I put the list instead of Tiles, it stops working. I am trying to create a simple application that contains tiles. I am new to SAPUI5. This is XML code.

<mvc:View height="100%" controllerName="sap.ui.demo.Onepage.view.App"
xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m">
<App>
    <Page id="" title="Tiles" class="marginBoxContent">
        <headerContent>
            <Button icon="sap-icon://filter" />
            <Button icon="sap-icon://action-settings" />
        </headerContent>
        <subHeader>
        </subHeader>
        <content>
            <TileContainer id="container" tileDelete="handleTileDelete"
                tiles="{
                        path: '/items'
                    }">
                <StandardTile icon="sap-icon://{icon}" type="{type}"
                    number="{number}" numberUnit="{numberUnit}" title="{title}" info="{info}"
                    infoState="{infoState}" />
            </TileContainer>
        </content>
        <footer>
        </footer>
    </Page>
</App>

      

Thanks in advance.

+1


source to share


1 answer


Sometimes the TileContainer can be a little more complicated. You have to take care of some attributes in the parent container. Make sure your page uses the following attribute:

<Page enableScrolling="false">

      

And another error might be that you are using data binding. As long as there is no object in your model /items

, no tiles will be displayed. So either make sure your model contains items

and the model is assigned to your view, or start testing it without binding to a property tiles

and do it like this:



<mvc:View height="100%" controllerName="sap.ui.demo.Onepage.view.App"
xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m">
<App>
    <Page id="" title="Tiles" class="marginBoxContent"
        enableScrolling="false">
        <headerContent>
            <Button icon="sap-icon://filter" />
            <Button icon="sap-icon://action-settings" />
        </headerContent>
        <subHeader>
        </subHeader>
        <content>
            <TileContainer id="container" tileDelete="handleTileDelete">
                <StandardTile icon="sap-icon://temperature" type="None"
                    number="23°" numberUnit="Celcius" title="Walldorf" info="Cloudy" />
            </TileContainer>
        </content>
        <footer>
        </footer>
    </Page>
</App>

      

+1


source







All Articles