<mvc:View
	controllerName="com.example.fiori.starter.controller.Home"
	xmlns:mvc="sap.ui.core.mvc"
	xmlns="sap.m"
	xmlns:f="sap.f"
	xmlns:core="sap.ui.core">
	<f:DynamicPage id="dynamicPage" toggleHeaderOnTitleClick="false">
		<f:title>
			<f:DynamicPageTitle>
				<f:heading>
					<Title text="{i18n>homeTitle}" />
				</f:heading>
				<f:actions>
					<Button
						id="bpWizardButton"
						text="{i18n>openBpWizard}"
						type="Emphasized"
						icon="sap-icon://customer"
						press=".onOpenBpWizard" />
					<Button
						id="bpWizard2Button"
						text="{i18n>openBpWizard2}"
						type="Transparent"
						icon="sap-icon://journey-change"
						press=".onOpenBpWizard2" />
					<Button
						id="bpWizard3Button"
						text="{i18n>openBpWizard3}"
						type="Transparent"
						icon="sap-icon://puzzle"
						press=".onOpenBpWizard3" />
					<Button
						id="bpWizard4Button"
						text="{i18n>openBpWizard4}"
						type="Transparent"
						icon="sap-icon://capital-projects"
						press=".onOpenBpWizard4" />
					<Button
						id="eliqButton"
						text="{i18n>openEliq}"
						type="Emphasized"
						icon="sap-icon://expense-report"
						press=".onOpenEliq" />
					<Button
						id="refreshButton"
						icon="sap-icon://refresh"
						tooltip="{i18n>refresh}"
						press=".onRefresh" />
				</f:actions>
			</f:DynamicPageTitle>
		</f:title>
		<f:header>
			<f:DynamicPageHeader pinnable="true">
				<SearchField
					width="100%"
					placeholder="{i18n>searchPlaceholder}"
					search=".onSearch"
					liveChange=".onSearch" />
			</f:DynamicPageHeader>
		</f:header>
		<f:content>
			<Table
				id="itemsTable"
				growing="true"
				growingThreshold="20"
				mode="None"
				items="{
					path: '/Items',
					sorter: { path: 'Title', descending: false }
				}">
				<headerToolbar>
					<OverflowToolbar>
						<Title text="{i18n>itemsListTitle}" level="H2" />
						<ToolbarSpacer />
						<Label text="{i18n>itemsCount}" />
					</OverflowToolbar>
				</headerToolbar>
				<columns>
					<Column width="12em">
						<Text text="{i18n>colId}" />
					</Column>
					<Column>
						<Text text="{i18n>colTitle}" />
					</Column>
					<Column minScreenWidth="Tablet" demandPopin="true">
						<Text text="{i18n>colStatus}" />
					</Column>
					<Column minScreenWidth="Desktop" demandPopin="true">
						<Text text="{i18n>colDescription}" />
					</Column>
				</columns>
				<items>
					<ColumnListItem type="Navigation" press=".onItemPress">
						<cells>
							<ObjectIdentifier title="{ItemId}" />
							<Text text="{Title}" />
							<ObjectStatus
								text="{Status}"
								state="{= ${Status} === 'Aperto' ? 'Success' : (${Status} === 'In corso' ? 'Information' : 'None') }" />
							<Text text="{Description}" />
						</cells>
					</ColumnListItem>
				</items>
			</Table>
		</f:content>
	</f:DynamicPage>
</mvc:View>
