cancel
Showing results for 
Search instead for 
Did you mean: 

Binding Column Headers for a table control in Fiori

Former Member
0 Kudos

Hi Experts,

I am trying to bind the column headers of a table to my model, but the data is not being set :

Please see JS Bin link below:

JS Bin - Collaborative JavaScript Debugging

Could you please take a look.

Regards,

Shashi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Friends,

I was able to solve this by setting the path as follows:

<Table xmlns="sap.m" id="idTable1" width="auto"

   items="{

      path:'/Values',

      sorter: {

        path: 'Col1'

      }

    }"

    >



<columns>


<Column id="idCol1">


<header>


<Text text="{path:'/ColHeader/ColH1'}" />


</header>


</Column>


<Column id="idCol2">


<header>


<Text text="{path:'/ColHeader/ColH1'}" />


</header>


</Column>


</columns>


<items>


<ColumnListItem>


<cells>


<Text xmlns="sap.m" text="{Col1}">


</Text>


<Text xmlns="sap.m" text="{Col2}" >


</Text>


</cells>


</ColumnListItem>


</items>


</Table>

santhu_gowdaz
Active Contributor
0 Kudos

Here local model so this is fine. But you are working on Fiori. how you will resolve this issue. need to hard code these label? better you may need to go for metadata model binding.

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Indrajit,

Thanks for your answer. How can we adapt the above solution for Fiori (xml views) to get dynamic number of columns.

Regards,

Shashi

santhu_gowdaz
Active Contributor
0 Kudos

You can't bind the metadata like above, check out my blog -