<mvc:View
	controllerName="sap.m.sample.TableTest.applicationUnderTest.view.Table"
	xmlns:mvc="sap.ui.core.mvc"
	xmlns:core="sap.ui.core"
	xmlns="sap.m"
	core:require="{Formatter:'sap/m/sample/TableTest/applicationUnderTest/view/Formatter'}">
	<Table id="idProductsTable"
		inset="false"
		items="{
			path: '/ProductCollection',
			sorter: {
				path: 'Name'
			}
		}">
		<headerToolbar>
			<Toolbar>
				<content>
					<Title text="Products" level="H2"/>
					<ToolbarSpacer />
					<ComboBox id="idPopinLayout"
						placeholder="Popin layout options"
						change="onPopinLayoutChanged">
						<items>
							<core:Item  text="Block"
								key="Block"/>
							<core:Item  text="Grid Large"
								key="GridLarge"/>
							<core:Item  text="Grid Small"
								key="GridSmall"/>
						</items>
					</ComboBox>
				</content>
			</Toolbar>
		</headerToolbar>
		<columns>
			<Column
				width="12em">
				<Text text="Product" />
			</Column>
			<Column
				minScreenWidth="Tablet"
				demandPopin="true">
				<Text text="Supplier" />
			</Column>
			<Column
				minScreenWidth="Desktop"
				demandPopin="true"
				hAlign="End">
				<Text text="Dimensions" />
			</Column>
			<Column
				minScreenWidth="Desktop"
				demandPopin="true"
				hAlign="Center">
				<Text text="Weight" />
			</Column>
			<Column
				hAlign="End">
				<Text text="Price" />
			</Column>
		</columns>
		<items>
			<ColumnListItem type="Navigation" press="onMessageDialogPress">
				<cells>
					<ObjectIdentifier
						title="{Name}"
						text="{ProductId}"/>
					<Text
						text="{SupplierName}" />
					<Text
						text="{Width} x {Depth} x {Height} {DimUnit}" />
					<ObjectNumber
						number="{WeightMeasure}"
						unit="{WeightUnit}"
						state="{
							parts: [
								{path: 'WeightMeasure'},
								{path: 'WeightUnit'}
							],
							formatter: '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>