Skip to content

Commit

Permalink
Added everything for Step 10: Property Formatting Using Data Types
Browse files Browse the repository at this point in the history
  • Loading branch information
wridgeu committed May 20, 2020
1 parent c828d13 commit d0a74fd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
4 changes: 3 additions & 1 deletion webapp/controller/Home.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ sap.ui.define(
city: "Walldorf",
zip: "69190",
country: "Germany"
}
},
salesToDate: 12345.6789,
currencyCode: "EUR"
});

//Set model globally for all views/controls (dirty) "sap.ui.getCore().setModel(oModel);""
Expand Down
2 changes: 1 addition & 1 deletion webapp/i18n/i18n.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ firstName=First Name
lastName=Last Name
enabled=Enabled
address=Address

salesToDate=Sales to Date

# Screen titles
panel1HeaderText=Data Binding Basics
Expand Down
2 changes: 2 additions & 0 deletions webapp/i18n/i18n_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ appDescription=UI5 Data Binding Walkthrough
firstName=Vorname
lastName=Nachname
enabled=Aktiviert
address=Adresse
salesToDate=Verk\u00e4ufe bis zum heutigen Datum

# Screen titles
panel1HeaderText=Data Binding Grundlagen
Expand Down
2 changes: 1 addition & 1 deletion webapp/i18n/i18n_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ firstName=First Name
lastName=Last Name
enabled=Enabled
address=Address

salesToDate=Sales to Date

# Screen titles
panel1HeaderText=Data Binding Basics
Expand Down
17 changes: 13 additions & 4 deletions webapp/view/Home.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,24 @@
<l:VerticalLayout>
<Label class="sapUiSmallMargin" text="{i18n>address}:"/>
<FormattedText class="sapUiSmallMarginBegin sapUiSmallMarginBottom" htmlText="{/address/street}&lt;br&gt;{/address/zip} {/address/city}&lt;br&gt;{/address/country}" width="200px"/>
<Link class="sapUiSmallMarginBegin"
href="{
<Link class="sapUiSmallMarginBegin" href="{
parts: [
'/firstName',
'/lastName'
],
formatter: '.formatter.formatMail'
}"
text="{i18n>sendEmail}"/>
}" text="{i18n>sendEmail}"/>
</l:VerticalLayout>
<l:VerticalLayout>
<Label text="{i18n>salesToDate}:" class="sapUiSmallMargin"/>
<Input width="200px" enabled="{/enabled}" description="{/currencyCode}" value="{
parts: [
{path: '/salesToDate'},
{path: '/currencyCode'}
],
type: 'sap.ui.model.type.Currency',
formatOptions: {showMeasure: false}
}"/>
</l:VerticalLayout>
</content>
</Panel>
Expand Down

0 comments on commit d0a74fd

Please sign in to comment.