Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Adding Footer to XML view is not working

Hi

I am trying to add a footer to my XML view, but it is giving me this error

My XML view (ApplyTicket.view.xml) code:

<mvc:View

   controllerName="ZEMPTICKETS.view.ApplyTicket"

   xmlns="sap.ui.table"

   xmlns:mvc="sap.ui.core.mvc"

   xmlns:u="sap.ui.unified"

   xmlns:c="sap.ui.core"

   xmlns:shellfooter="sap.ushell.ui.footerbar"

   xmlns:m="sap.m">

   <m:Page

     showHeader="false"

     enableScrolling="false"

     class="sapUiContentPadding">

     <m:content>

      

       <Table

         rows="{/RequestItemSet}"

         title="Members"

         selectionMode="MultiToggle"

         visibleRowCount="7">

         <columns>

           <Column width="11rem">

             <m:Label text="Family Member Name" />

             <template>

               <m:Text text="{FamilyMemberName}"/>

             </template>

           </Column>

           <Column width="11rem">

             <m:Label text="Family Relation Name" />

             <template>

               <m:Text text="{FamilyRelationName}"/>

             </template>

           </Column>

           <Column width="6rem" hAlign="End">

             <m:Label text="Base Fare" />

             <template>

               <m:Text text="{BaseFare}"/>

             </template>

           </Column>

           <Column width="9rem">

             <m:Label text="Taxes" />

             <template>

               <m:Text text="{Taxes}"/>

             </template>

           </Column>

           <Column width="9rem">

             <m:Label text="Total Fare" />

             <template>

               <m:Text text="{TotalFare}"/>

             </template>

           </Column>

           <Column width="7rem">

             <m:Label text="Select" />

             <template>

               <m:CheckBox selected="{

                path: 'select',

                type: 'sap.ui.model.type.String'

              }"/>

             </template>

           </Column>

         </columns>

       </Table>

     </m:content>

<footer>

       <Toolbar>

           <Button text="Submit" type="Accept" />

       </Toolbar>

     </footer>

   </m:Page>

</mvc:View>

Where is the problem?

thanks in advance

Tags:
replied

Your namespace is wrong

You have defined sap.m as "m", so it should be:

<m:footer>

    <m:Toolbar>

        <m:Button text="Submit" type="Accept" />

    </m:Toolbar>

</m:footer>

However, as a rule of thumb, you should define the default namespace to be the one with the controls most used (in 99% of the cases, this will be sap.m or sap.ui.commons, depending on your library)

So specify a namespace for sap.ui.table, and assign the default namespace to sap.m. Any future developers after you will thank you for that

2 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question