<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: SAPUI5 formatter function not working properly inside Input Control in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sapui5-formatter-function-not-working-properly-inside-input-control/qaa-p/12326321#M4617601</link>
    <description>&lt;P&gt;Any alternative to get the value in the controller function ? &lt;/P&gt;</description>
    <pubDate>Sun, 21 Mar 2021 07:56:48 GMT</pubDate>
    <dc:creator>MKM</dc:creator>
    <dc:date>2021-03-21T07:56:48Z</dc:date>
    <item>
      <title>SAPUI5 formatter function not working properly inside Input Control</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-formatter-function-not-working-properly-inside-input-control/qaq-p/12326319</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt;I need to highlight a few of the table's cell border colors on the basis of a condition and pre-fill it with some negative value.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;View.xml&lt;/STRONG&gt;&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;t:Column width="100px"&amp;gt;
    &amp;lt;Label text="ActualQty"/&amp;gt;
    &amp;lt;t:template&amp;gt;
       &amp;lt;Input id="idInput" value="{ parts: [ {path: 'viewData&amp;gt;ACT_QTY'}, {path: 'viewData&amp;gt;MTART'} ], formatter: '._formatter.defaultInput' }"&amp;gt;
            &amp;lt;customData&amp;gt;
                &amp;lt;core:CustomData key="colorclass" value="{path: 'viewData&amp;gt;MTART', formatter: '._formatter.formatCell'}" writeToDom="true"/&amp;gt;
            &amp;lt;/customData&amp;gt;
       &amp;lt;/Input&amp;gt;
    &amp;lt;/t:template&amp;gt;
&amp;lt;/t:Column&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;STRONG&gt;Formatter.js&lt;/STRONG&gt;&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt; formatCell: function (iValue) {
        try {
            iValue.toString();
        } catch (err) {
            iValue = "foo";
        }
        return iValue.toString();
    },

    defaultInput: function (iValue, iValue1) {

        if (iValue !== 0 &amp;amp;&amp;amp; iValue1 === "HALB") {
            iValue = "-1";
            return iValue;
        } else {
            return iValue;
        }
    }&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;STRONG&gt;style.css&lt;/STRONG&gt;&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;  div[data-colorclass="HALB"] { 
      border: 4px solid #fdf6b1 !important;
    }&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Highlighting and the default value is appearing. But inside the controller, The input value is not coming.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1907551-view.png" /&gt;&lt;/P&gt;
  &lt;P&gt;if I remove parts and pass single input param to formatter function, its working. But I need both the values to built my logic.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 15:58:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-formatter-function-not-working-properly-inside-input-control/qaq-p/12326319</guid>
      <dc:creator>MKM</dc:creator>
      <dc:date>2021-03-19T15:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 formatter function not working properly inside Input Control</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-formatter-function-not-working-properly-inside-input-control/qaa-p/12326320#M4617600</link>
      <description>&lt;P&gt;once you use formatter, it is oneway binding, means model---&amp;gt;UI, your input change in ui won't come to model.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 16:54:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-formatter-function-not-working-properly-inside-input-control/qaa-p/12326320#M4617600</guid>
      <dc:creator>junwu</dc:creator>
      <dc:date>2021-03-19T16:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 formatter function not working properly inside Input Control</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-formatter-function-not-working-properly-inside-input-control/qaa-p/12326321#M4617601</link>
      <description>&lt;P&gt;Any alternative to get the value in the controller function ? &lt;/P&gt;</description>
      <pubDate>Sun, 21 Mar 2021 07:56:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-formatter-function-not-working-properly-inside-input-control/qaa-p/12326321#M4617601</guid>
      <dc:creator>MKM</dc:creator>
      <dc:date>2021-03-21T07:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 formatter function not working properly inside Input Control</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-formatter-function-not-working-properly-inside-input-control/qaa-p/12326322#M4617602</link>
      <description>&lt;P&gt;Now I understood, the formatter function will make it one-way binding. The link has a &lt;A href="https://stackoverflow.com/questions/56484815/updating-model-in-ui5-two-way-data-binding-becomes-one-way-when-using-formatter"&gt;solution&lt;/A&gt; using custom type to make it two-way binding. But I am not able to create the Type for my case. Please guide.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 10:22:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-formatter-function-not-working-properly-inside-input-control/qaa-p/12326322#M4617602</guid>
      <dc:creator>MKM</dc:creator>
      <dc:date>2021-03-22T10:22:03Z</dc:date>
    </item>
  </channel>
</rss>

