diff --git a/steps/20/README.md b/steps/20/README.md index 1b90b4b7..51521f41 100644 --- a/steps/20/README.md +++ b/steps/20/README.md @@ -46,7 +46,7 @@ export default class App extends Controller { We add the invoice list controller to the view to get access to the view model we defined in the controller. -We add a price and the currency to our invoices list in the view by adding the `number` attribute to the `ObjectListItem` control, then we apply the currency data type on the number by setting the `type` attribute of the binding syntax to `sap.ui.model.type.Currency`. The `Currency` type will handle the formatting of the price for us, based on the currency code. In our case, the price is displayed with 2 decimals. +We add a price and the currency to our invoices list in the view by adding the `number` attribute to the `ObjectListItem` control. To apply the currency data type, we use the `require` attribute with the namespace URI `sap.ui.core`, for which the prefix `core` is already defined in our XML view. This allows us to write the attribute as `core:require`. We then add the currency data type module to the list of required modules and assign it the alias `Currency`, making it available for use within the view. Then we set the `type` attribute of the binding syntax to the alias `Currency`. The `Currency` type will handle the formatting of the price for us, based on the currency code. In our case, the price is displayed with 2 decimals. Additionally, we set the formatting option `showMeasure` to `false`. This hides the currency code in the property `number`. Instead we pass the currency on to the `ObjectListItem` control as a separate property `numberUnit`. @@ -54,6 +54,7 @@ Additionally, we set the formatting option `showMeasure` to `false`. This hides /currency}"/> - \ No newline at end of file + diff --git a/steps/21/README.md b/steps/21/README.md index 83927afa..79c3b137 100644 --- a/steps/21/README.md +++ b/steps/21/README.md @@ -28,6 +28,7 @@ We add the `numberState` attribute to the `ObjectListItem` control in our invoic ExtendedPrice} > 50 ? 'Error' : 'Success' }"/> - \ No newline at end of file + diff --git a/steps/22/README.md b/steps/22/README.md index 5fbdbd71..7ec295be 100644 --- a/steps/22/README.md +++ b/steps/22/README.md @@ -97,13 +97,16 @@ We add a status using the `firstStatus` aggregation to our `ObjectListItem` that items="{invoice>/Invoices}" > /Invoices}" > ... Quantity}" emphasized="false"/> + title="{invoice>ProductName}" /> + path: 'invoice>Status', + formatter: '.formatter.statusText' + }"/> ExtendedPrice', + 'view>/currency' + ], + type: 'Currency', + formatOptions: { + showMeasure: false + } + }" unit="{view>/currency}" state="{= ${invoice>ExtendedPrice} > 50 ? 'Error' : 'Success' }"/> @@ -203,4 +206,4 @@ We can see the results when we decrease the browser's screen size or open the ap **Related Information** -[Configuring Responsive Behavior of a Table](https://sdk.openui5.org/topic/38855e06486f4910bfa6f4485f7c2bac.html "OpenUI5 supports column-based and row-based solutions to support flexible and clearly arranged tables.") \ No newline at end of file +[Configuring Responsive Behavior of a Table](https://sdk.openui5.org/topic/38855e06486f4910bfa6f4485f7c2bac.html "OpenUI5 supports column-based and row-based solutions to support flexible and clearly arranged tables.") diff --git a/steps/34/webapp/view/InvoiceList.view.xml b/steps/34/webapp/view/InvoiceList.view.xml index ff1fda4d..c08ca3d3 100644 --- a/steps/34/webapp/view/InvoiceList.view.xml +++ b/steps/34/webapp/view/InvoiceList.view.xml @@ -67,12 +67,15 @@ dateTitle}" text="{ path: 'invoice>OrderDate', - type: 'sap.ui.model.type.Date' + type: 'Date', + formatOptions: { + style: 'long', + source: { + pattern: 'yyyy-MM-ddTHH:mm:ss' + } + } }"/> diff --git a/steps/35/webapp/view/Detail.view.xml b/steps/35/webapp/view/Detail.view.xml index 542ad9fa..172befcb 100644 --- a/steps/35/webapp/view/Detail.view.xml +++ b/steps/35/webapp/view/Detail.view.xml @@ -1,44 +1,55 @@ - - + + + + + - - - - - - - - \ No newline at end of file + } + }"/> + + + + + diff --git a/steps/35/webapp/view/InvoiceList.view.xml b/steps/35/webapp/view/InvoiceList.view.xml index ff1fda4d..268e28b7 100644 --- a/steps/35/webapp/view/InvoiceList.view.xml +++ b/steps/35/webapp/view/InvoiceList.view.xml @@ -67,12 +67,15 @@ - - + + + + + - - - - - - - - \ No newline at end of file + } + }"/> + + + + + diff --git a/steps/36/webapp/view/InvoiceList.view.xml b/steps/36/webapp/view/InvoiceList.view.xml index ff1fda4d..268e28b7 100644 --- a/steps/36/webapp/view/InvoiceList.view.xml +++ b/steps/36/webapp/view/InvoiceList.view.xml @@ -67,12 +67,15 @@ - - + + + + + - - - - - - - - \ No newline at end of file + } + }"/> + + + + + diff --git a/steps/37/webapp/view/InvoiceList.view.xml b/steps/37/webapp/view/InvoiceList.view.xml index e0b813d4..aec957bd 100644 --- a/steps/37/webapp/view/InvoiceList.view.xml +++ b/steps/37/webapp/view/InvoiceList.view.xml @@ -70,12 +70,15 @@ - - + + + + + - - - - - - - - \ No newline at end of file + } + }"/> + + + + + diff --git a/steps/38/webapp/view/InvoiceList.view.xml b/steps/38/webapp/view/InvoiceList.view.xml index 81fa0590..59e9292e 100644 --- a/steps/38/webapp/view/InvoiceList.view.xml +++ b/steps/38/webapp/view/InvoiceList.view.xml @@ -77,12 +77,15 @@