<core:FragmentDefinition
        xmlns="sap.m"
        xmlns:core="sap.ui.core"
        xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
        xmlns:build="sap.build">

    <items>
        <!-- Title is first Row first Column -->
        <!-- number is first Row second Column -->
        <ObjectListItem
                id="listItem"
                class="sapOvpObjectListItem sapOvpListFragment sapUiContentPadding"
                title="{parts:[{path:'lineItem>'}, {path:'ovpConstants>/firstDataFieldIndex'}], formatter: 'sap.ovp.cards.AnnotationHelper.formatDataFieldValueOnIndex'}"
                number="{parts:[{path:'lineItem>'}, {path:'ovpConstants>/firstDataPointIndex'}, {path:'ovpConstants>/thirdDataFieldIndex'}], formatter: 'sap.ovp.cards.AnnotationHelper.formatDataPointOrField'}"
                numberState="{= ${path: 'lineItem>', formatter: 'sap.ovp.cards.AnnotationHelper.getDataPointsCount'} > 0 ? ${path: 'lineItem>', formatter: 'sap.ovp.cards.AnnotationHelper.formatFirstDataPointState'} : 'None' }"
                type="Active"
                press="onListItemPress">
            <attributes>
                <!--This is second Row first Column -->
                <ObjectAttribute id="listItem2Row1Column"
                                 text="{parts:[{path:'lineItem>'}, {path:'ovpConstants>/secondDataFieldIndex'}], formatter: 'sap.ovp.cards.AnnotationHelper.formatDataFieldValueOnIndex'}"/>
                <!--This is third Row first Column -->
                <template:if test="{= ${path: 'lineItem>', formatter: 'sap.ovp.cards.AnnotationHelper.getDataPointsCount'} > 1}" >
                    <template:then>
                        <ObjectAttribute id="listItem3row1column"
                                         text="{parts:[{path:'lineItem>'}, {path:'ovpConstants>/thirdDataFieldIndex'}], formatter: 'sap.ovp.cards.AnnotationHelper.formatDataFieldValueOnIndex'}"/>
                    </template:then>
                    <template:else>
                        <template:if test="{= ${path: 'lineItem>', formatter: 'sap.ovp.cards.AnnotationHelper.getDataPointsCount'} > 0}" >
                            <template:then>
                                <ObjectAttribute id="listItem3row1column"
                                                 text="{parts:[{path:'lineItem>'}, {path:'ovpConstants>/fourthDataFieldIndex'}], formatter: 'sap.ovp.cards.AnnotationHelper.formatDataFieldValueOnIndex'}"/>
                            </template:then>
                            <template:else>
                                <ObjectAttribute id="listItem3row1column" text="{parts:[{path:'lineItem>'}, {path:'ovpConstants>/fifthDataFieldIndex'}], formatter: 'sap.ovp.cards.AnnotationHelper.formatDataFieldValueOnIndex'}"/>
                            </template:else>
                        </template:if>
                    </template:else>
                </template:if>
            </attributes>
            <!-- This is Second Row Second Column -->
            <firstStatus>
                <template:if test="{= ${path: 'lineItem>', formatter: 'sap.ovp.cards.AnnotationHelper.getDataPointsCount'} > 1}" >
                    <template:then>
                        <ObjectStatus
                                id="listItem2row2column"
                                text="{parts:[{path:'lineItem>'}, {path:'ovpConstants>/secondDataPointIndex'}], formatter: 'sap.ovp.cards.AnnotationHelper.formatDataPointValueOnIndex'}"
                                state="{path: 'lineItem>', formatter: 'sap.ovp.cards.AnnotationHelper.formatSecondDataPointState'}"/>
                    </template:then>
                    <template:else>
                        <template:if test="{= ${path: 'lineItem>', formatter: 'sap.ovp.cards.AnnotationHelper.getDataPointsCount'} > 0}" >
                            <template:then>
                                <ObjectStatus
                                        id="listItem2row2column"
                                        text="{parts:[{path:'lineItem>'}, {path:'ovpConstants>/thirdDataFieldIndex'}], formatter: 'sap.ovp.cards.AnnotationHelper.formatDataFieldValueOnIndex'}"
                                        state="None" />
                            </template:then>
                            <template:else>
                                <ObjectStatus
                                        id="listItem2row2column"
                                        text="{parts:[{path:'lineItem>'}, {path:'ovpConstants>/fourthDataFieldIndex'}], formatter: 'sap.ovp.cards.AnnotationHelper.formatDataFieldValueOnIndex'}"
                                        state="None" />
                            </template:else>
                        </template:if>
                    </template:else>
                </template:if>
            </firstStatus>
            <!-- This is Third Row Second Column -->
            <secondStatus>
                <template:if test="{= ${path: 'lineItem>', formatter: 'sap.ovp.cards.AnnotationHelper.getDataPointsCount'} > 2}" >
                    <template:then>
                        <ObjectStatus
                                id="listItem3row2column"
                                text="{parts:[{path:'lineItem>'}, {path:'ovpConstants>/thirdDataPointIndex'}], formatter: 'sap.ovp.cards.AnnotationHelper.formatDataPointValueOnIndex'}"
                                state="{path: 'lineItem>', formatter: 'sap.ovp.cards.AnnotationHelper.formatThirdDataPointState'}"/>
                    </template:then>
                    <template:else>
                        <template:if test="{= ${path: 'lineItem>', formatter: 'sap.ovp.cards.AnnotationHelper.getDataPointsCount'} > 1}" >
                            <template:then>
                                <ObjectStatus
                                        id="listItem3row2column"
                                        text="{parts:[{path:'lineItem>'}, {path:'ovpConstants>/fourthDataFieldIndex'}], formatter: 'sap.ovp.cards.AnnotationHelper.formatDataFieldValueOnIndex'}"
                                        state="None" />
                            </template:then>
                            <template:else>
                                <template:if test="{= ${path: 'lineItem>', formatter: 'sap.ovp.cards.AnnotationHelper.getDataPointsCount'} > 0}" >
                                    <template:then>
                                        <ObjectStatus
                                                id="listItem3row2column"
                                                text="{parts:[{path:'lineItem>'}, {path:'ovpConstants>/fifthDataFieldIndex'}], formatter: 'sap.ovp.cards.AnnotationHelper.formatDataFieldValueOnIndex'}"
                                                state="None" />
                                    </template:then>
                                    <template:else>
                                        <ObjectStatus
                                                id="listItem3row2column"
                                                text="{parts:[{path:'lineItem>'}, {path:'ovpConstants>/sixthDataFieldIndex'}], formatter: 'sap.ovp.cards.AnnotationHelper.formatDataFieldValueOnIndex'}"
                                                state="None" />
                                    </template:else>
                                </template:if>
                            </template:else>
                        </template:if>
                    </template:else>
                </template:if>
            </secondStatus>
        </ObjectListItem>
    </items>

</core:FragmentDefinition>
