Skip to content

Instantly share code, notes, and snippets.

@sodogan
Created December 20, 2021 16:25
Show Gist options
  • Save sodogan/243cf1d7c241afe72d8c7105d5232280 to your computer and use it in GitHub Desktop.
Save sodogan/243cf1d7c241afe72d8c7105d5232280 to your computer and use it in GitHub Desktop.
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:f="sap.ui.layout.form">
<List headerText="{i18n>productListTitle}" items="{/ProductSet}">
<ObjectListItem title="{Name}" intro="{ProductID}"
number="{ parts:[{path:'Price'},{path:'CurrencyCode'}], type: 'sap.ui.model.type.Currency', formatOptions: {showMeasure: false} }"
type="Active" press="onListItemPress" numberUnit="{CurrencyCode}"
numberState="{= ${Price} &gt; 1000 &amp;&amp;${Price} &lt; 1500 &amp;&amp; ${CurrencyCode} ==='USD' ? 'Error' : 'Success' }"
>
<firstStatus>
<ObjectStatus
text="{Price}"
state="{
parts:[{path:'Price'}],
formatter: '.formatter.status'
}" />
</firstStatus>
<ObjectAttribute text="{WeightMeasure} {WeightUnit}" visible ="{= ${WeightMeasure} > 0 }" title="Weight"/>
<ObjectAttribute text="{Width} x {Depth} x {Height} {DimUnit}" visible ="{= ${path:'CurrencyCode'} ==='EUR' ? true: false }" />
</ObjectListItem>
</List>
</core:FragmentDefinition>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment