cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Render table using XML View

Former Member
0 Likes
665

Hi everyone!

Trying to render table using XML this way:

<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.ui.commons" xmlns:table="sap.ui.table"

           controllerName="career.appraisal" xmlns:html="http://www.w3.org/1999/xhtml">

    <table:Table id="tblAppraisals" table:selectionMode="none">

              <table:title><TextView text="Table header"></TextView></table:title>

              <table:columns>

                        <table:Column>

                                  <Label text="Column 1"/>

                                        <table:Template><TextView text="{col1}" /></table:Template>

                        </table:Column>

                        <table:Column>

                                  <Label text="Column 2"/>

                                        <table:Template><TextView text="{col2}" /></table:Template>

                        </table:Column>

                        <table:Column>

                                  <Label text="Column 3"/>

                                        <table:Template><TextView text="{col3}" /></table:Template>

                        </table:Column>

              </table:columns>

    </table:Table>

</core:View>

Got an error:

GET http://localhost:53443/Branding/resources/sap/ui/table/Template.js 404 (Resource could not be found!) sap-ui-core.js:25

Uncaught Error: failed to load 'sap.ui.table.Template' from resources/sap/ui/table/Template.js: 404 - Resource could not be found!

What is the proper way to set template for column?

In JSView we can just call setTemplate.

View Entire Topic
Former Member
0 Likes

Hi Nikolay,

Just a simple error in your code. You have used capital 'T' for template which is not correct. Please use this  <table:template> and code will run properly.

Corrected Code:-

Result Page:-

Best Regards,

Bibhas Das

Former Member
0 Likes

Bibhas,

Thanks for your reply, that was what I needed.

Unfortunately the XML views are still poorly documented.