Skip to content

Instantly share code, notes, and snippets.

@sodogan
Created December 21, 2021 11:53
Show Gist options
  • Save sodogan/fa38c8399421fbdcaac4aea6c19ab24a to your computer and use it in GitHub Desktop.
Save sodogan/fa38c8399421fbdcaac4aea6c19ab24a 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' }">
<ObjectAttribute text="{WeightMeasure} {WeightUnit}" visible="{= ${WeightMeasure} > 0 }" title="Weight"/>
<ObjectAttribute text="{Width} x {Depth} x {Height} {DimUnit}" visible="{= ${path:'CurrencyCode'} ==='EUR' ? true: false }"/>
<firstStatus>
<ObjectStatus text="{parts:[{path: 'WeightMeasure'},{path:'WeightUnit'}], formatter: '.formatter.deliveryStatus' }"/>
</firstStatus>
<markers>
<ObjectMarker type ="{= ['HT-1000','HT-1001'].includes(${ProductID}) ? 'Favorite' : 'Flagged' }"></ObjectMarker>
</markers>
</ObjectListItem>
</List>
</core:FragmentDefinition>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment