<?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: Use static value for formatter in xml in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaa-p/12404019#M4642663</link>
    <description>&lt;P&gt;Does the formatter get called at all without the "value"? How does your formatter look like? What does the OpenUI5 Version / Distribution say when you press [Ctrl] + [Shift] + [Left Alt] + [P]?&lt;/P&gt;&lt;P&gt;We need more information. Please update the question accordingly.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Aug 2021 11:25:30 GMT</pubDate>
    <dc:creator>boghyon</dc:creator>
    <dc:date>2021-08-11T11:25:30Z</dc:date>
    <item>
      <title>Use static value for formatter in xml</title>
      <link>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaq-p/12404018</link>
      <description>&lt;P&gt;I want to use a static value on xml, to use it in formatter. I found this comment on &lt;A href="https://stackoverflow.com/questions/37317223/pass-static-value-to-formatter-parameters-in-xml-view/53609552#53609552"&gt;stackoverflow&lt;/A&gt; but this doesn't work for me.&lt;/P&gt;
  &lt;P&gt;I use the version 1.70, i see the feature is &lt;A href="https://github.com/SAP/openui5/commit/c7b953e85eed283fd6cac90323bfaf59e3388410"&gt;after 1.61&lt;/A&gt; available. &lt;/P&gt;
  &lt;P&gt;My code:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;{ parts: [
	{path: 'modelName&amp;gt;/processState'}, 
	{value: 'german'}
], formatter: '.translation'}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;In my app i dont get any text.&lt;/P&gt;
  &lt;P&gt;EDIT:&lt;/P&gt;
  &lt;P&gt;You know the code above don't work.&lt;/P&gt;
  &lt;P&gt;If i change to this:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;{ parts: [
	{path: 'modelName&amp;gt;/processState'}, 
	{path: 'modelName&amp;gt;/german'}
], formatter: '.translation'}

&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;But in this solution i must set the property "german" to german in JS.&lt;/P&gt;
  &lt;P&gt;This is my formatter&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;translation: function(sKey, sLanguage){
	return this.text(sKey, sLanguage)
}
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;My OpenUI5 Version was 1.78.8&lt;/P&gt;
  &lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 06:21:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaq-p/12404018</guid>
      <dc:creator>former_member842244</dc:creator>
      <dc:date>2021-08-11T06:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Use static value for formatter in xml</title>
      <link>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaa-p/12404019#M4642663</link>
      <description>&lt;P&gt;Does the formatter get called at all without the "value"? How does your formatter look like? What does the OpenUI5 Version / Distribution say when you press [Ctrl] + [Shift] + [Left Alt] + [P]?&lt;/P&gt;&lt;P&gt;We need more information. Please update the question accordingly.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 11:25:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaa-p/12404019#M4642663</guid>
      <dc:creator>boghyon</dc:creator>
      <dc:date>2021-08-11T11:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Use static value for formatter in xml</title>
      <link>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaa-p/12404020#M4642664</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;if you need to set the property to "german", why you don't use a constant in the formatter function and pass only sKey as parameter?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;translation: function(sKey){
	return this.text(sKey, 'german')
}&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Aug 2021 12:29:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaa-p/12404020#M4642664</guid>
      <dc:creator>ThorstenHoefer</dc:creator>
      <dc:date>2021-08-11T12:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Use static value for formatter in xml</title>
      <link>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaa-p/12404021#M4642665</link>
      <description>&lt;P&gt;It's a &lt;STRONG&gt;bug in UI5&lt;/STRONG&gt; which was reported last year and has been &lt;STRONG&gt;fixed since version 1.80&lt;/STRONG&gt;. See the GitHub &lt;A href="https://github.com/SAP/openui5/issues/2916"&gt;issue "CompositeBinding parts mixed with named models and StaticBindings incompatible when creating ManagedObject declaratively"&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Until the app can run with a newer version, you can circumvent the bug with the following &lt;STRONG&gt;temporary solution&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{
  parts: [
    { path: 'modelName&amp;gt;/processState' },
    { value: 'german', model: 'modelName' }
  ],
  formatter: '.translation'
}
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Simply add the model name from one of the parts to the value binding info.&lt;/P&gt;&lt;P&gt;You might get an error log in the console but that can be ignored. &lt;STRONG&gt;Better update the UI5 version ASAP&lt;/STRONG&gt; and remove the above workaround since &lt;A href="https://ui5.sap.com/versionoverview.html"&gt;SAPUI5 1.78 is already "out of maintenance".&lt;/A&gt;&lt;/P&gt;&lt;P&gt;____&lt;/P&gt;&lt;P&gt;Same issue: &lt;A href="https://stackoverflow.com/q/61816223/5846045" target="test_blank"&gt;https://stackoverflow.com/q/61816223/5846045&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 20:06:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaa-p/12404021#M4642665</guid>
      <dc:creator>boghyon</dc:creator>
      <dc:date>2021-08-11T20:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Use static value for formatter in xml</title>
      <link>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaa-p/12404022#M4642666</link>
      <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;xtrnhfo&lt;/SPAN&gt; One of the advantages of using "value" is to be able to re-use the formatter in other bindings but with different static values. The above issue is a bug in UI5.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 20:46:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaa-p/12404022#M4642666</guid>
      <dc:creator>boghyon</dc:creator>
      <dc:date>2021-08-11T20:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Use static value for formatter in xml</title>
      <link>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaa-p/12404023#M4642667</link>
      <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;xtrnhfo&lt;/SPAN&gt;,&lt;BR /&gt;i want use the formatter for other languages, for example english or france.&lt;/P&gt;&lt;P&gt;But thank you for the comments.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 21:11:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaa-p/12404023#M4642667</guid>
      <dc:creator>former_member842244</dc:creator>
      <dc:date>2021-08-11T21:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Use static value for formatter in xml</title>
      <link>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaa-p/12404024#M4642668</link>
      <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;boghyon.hoffmann&lt;/SPAN&gt; ,&lt;/P&gt;&lt;P&gt;Thank You for the greate Answer. It works with the &lt;STRONG&gt;temporary solution &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;But u have right, i increase the version!&lt;/P&gt;&lt;P&gt;Thank you very much. U made my day &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Greetz&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 21:20:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-static-value-for-formatter-in-xml/qaa-p/12404024#M4642668</guid>
      <dc:creator>former_member842244</dc:creator>
      <dc:date>2021-08-11T21:20:12Z</dc:date>
    </item>
  </channel>
</rss>

