<mvc:View
	controllerName="sap.m.sample.TablePerso.Table"
	xmlns:mvc="sap.ui.core.mvc"
	xmlns:core="sap.ui.core"
	xmlns="sap.m">
	<Table id="productsTable"
		items="{/ProductCollection}">
		<headerToolbar>
			<OverflowToolbar>
				<Title text="Products" level="H2"/>
				<ToolbarSpacer/>
				<!-- Add the Grouping checkbox -->
				<CheckBox text="Enable Personalization Grouping" select="onTableGrouping" />
				<!-- Add the Refresh button -->
				<Button icon="sap-icon://refresh" press="onTablePersoRefresh" >
					<layoutData>
						<OverflowToolbarLayoutData priority="NeverOverflow" />
					</layoutData>
				</Button>
				<!-- Add the Personalization button -->
				<Button icon="sap-icon://action-settings" press="onPersoButtonPressed" >
					<layoutData>
						<OverflowToolbarLayoutData priority="NeverOverflow" />
					</layoutData>
				</Button>
			</OverflowToolbar>
		</headerToolbar>
		<columns>
			<Column id="productCol" width="12em"><Text text="Product" /></Column>
			<Column id="supplierCol" minScreenWidth="Tablet" demandPopin="true"><Text text="Supplier" /></Column>
			<Column id="dimensionsCol" visible="false" minScreenWidth="Tablet" demandPopin="true" hAlign="End"><Text text="Dimensions" /></Column>
			<Column id="weightCol" visible="false" minScreenWidth="Tablet" demandPopin="true" hAlign="Center"><Text text="Weight" /></Column>
			<Column id="priceCol" hAlign="End"><Text text="Price" /></Column>
		</columns>
		<items>
			<ColumnListItem vAlign="Middle">
				<cells>
					<ObjectIdentifier title="{Name}" text="{ProductId}" class="sapUiTinyMarginTopBottom" />
					<Text text="{SupplierName}" />
					<Text text="{Width} x {Depth} x {Height} {DimUnit}" />
					<ObjectNumber number="{WeightMeasure}" unit="{WeightUnit}"
						state="{
							path: 'WeightMeasure',
							formatter: 'sap.m.sample.TablePerso.Formatter.weightState'
						}" />
					<ObjectNumber
                        number="{
                            parts:[{path:'Price'},{path:'CurrencyCode'}],
                            type: 'sap.ui.model.type.Currency',
                            formatOptions: {showMeasure: false}
                        }"
                        unit="{CurrencyCode}" />
				</cells>
			</ColumnListItem>
		</items>
	</Table>
</mvc:View>