Skip to Content
0
Nov 23, 2018 at 03:55 PM

Form with fields including currencies

59 Views

Hi all,

I need a two-column form, one of the fields has a currency that must be internationalized. (eg: Fr: 2000$ , Usa: $2000)

Why Label 2 and Text 2 doesnt align with label 5?

How can i reduce the interline between Label 2 and the label from below ?

Why they are a big space between label cost and his value and how to reduce this space (like the other)

i try to replace Currency to Text with formatter named formatCurrency (cf code) but i have juste one value..

As well how to apply the internationalize for my currency ?

<form:SimpleForm id="SimpleFormChange354wideDual"
                 editable="true"
                 layout="ResponsiveGridLayout"
                 labelSpanXL="4"
                 labelSpanL="3"
                 labelSpanM="4"
                 adjustLabelSpan="false"
                 emptySpanXL="0"
                 emptySpanL="4"
                 columnsXL="2">
  <form:content>

    <core:Title text=""/>
    <m:Label text="{i18n>Label}"/>
    <m:Text id="name" text="Text"/>
    <m:Label text="{i18n>Label}"/>
    <m:Text text="{Type}"/>
    <m:Label text="{i18n>Label}"/>
    <m:Text text="{TrainingDetails/Description}"/>
    <core:Title text=""/>
    <m:Label text="{i18n>LabelTextTrainingCost}"/>
    <u:Currency value="{path: '/Cost', formatter: '.formatter.stringToFloat'}"
                currency="{/Currency}"/>
    <m:Label text="{i18n>LabelText}"/>
    <m:Text text="{T}"/>
  </form:content>
</form:SimpleForm>
formatCurrency: function (...aValues) {
  let sBrowserLocale = sap.ui.getCore().getConfiguration().getLanguage();
  let oLocale = new sap.ui.core.Locale(sBrowserLocale);
  let oLocaleData = new sap.ui.core.LocaleData(oLocale);
  return oLocaleData.getCurrencySymbol(aValues[1]);
},

sorry for the syntax of sentences... English is not my main language

thank you in advance !