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

SAP UI5 - Dynamic count in Icon Tab Bar Filter based on Table entries

Former Member
0 Kudos
2,987

Hi All,

I have a requirement, wherein I am displaying a sap.m.table under an Icon Tab Bar. Now, I need to show the count of the total number of records in table. I am using the following code:-

Even though, there are records in the table, it is still not displaying the count on the IconTabBar Filter. Please suggest.

RegardsMeenakshi
View Entire Topic
former_member626660
Participant

Hi Meenakshi,

My suggestion to you would be to check if you binding paths are right, for example if your JSONModel is of the below structure

"AvailParts":{
           "AvailCount": "10",
           "results":[/*array of Row items*/]
}

where "AvailCount" holds the value of the number of rows in your table under the named model "AvailParts" then try the below binding

<IconTabFilter key="1" id="id_Availparts_KP" count="{AvailParts>AvailCount}">
<Table id="id_AvailParts" items="{AvailParts>/results}">
                         <columns>
                         <Column  width="12em">
				<Text text="Product" />
			</Column>
/* number of columns as per your requirement*/
                        </columns>
                        <items>
			<ColumnListItem vAlign="Middle">
			<cells>
/*considering Name and ProductId are attributes in your results list*/
		        <ObjectIdentifier title="{AvailParts>Name}"
					text="{AvailParts>ProductId}"/>
                        </cells>
			</ColumnListItem>
		</items>
	</Table>

Or you can also bind this results' array length to the icon tab filter through your controller coding. For that use setCount Method of IconTabFilter.

Hope this information helps you.. 🙂

Happy learning!!

Regards

Imtiaz N