<?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: SmartField dependency filter in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/smartfield-dependency-filter/qaa-p/640759#M161152</link>
    <description>&lt;P&gt;Solved it.&lt;/P&gt;
  &lt;P&gt;Seems, all Smart Objects, have inside the proper component it uses, so for example in a SmartField type Select, it has a sap.m.select inside, and when you access this one, is the same as for all other components, get the binding context and then filter.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;_onCategoryChange: function(oEvent){
      var vValue = oEvent.getSource().getValue();
      var oFilter = new sap.ui.model.Filter({
                path: "Test",
                operator: sap.ui.model.FilterOperator.EQ,
                value1: vValue
      });
      //var oSubcategory   = sap.ui.getCore().byId('SFIESubcategory');    //This is the SmartField
      var oSubcategoryList = sap.ui.getCore().byId("SFIESubcategory").getContent();
      var oBinding         = oSubcategoryList.getBinding("items");
      oBinding.filter[oFilter];
},
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 19 Jun 2018 08:21:39 GMT</pubDate>
    <dc:creator>CristianBabei</dc:creator>
    <dc:date>2018-06-19T08:21:39Z</dc:date>
    <item>
      <title>SmartField dependency filter</title>
      <link>https://community.sap.com/t5/technology-q-a/smartfield-dependency-filter/qaq-p/640758</link>
      <description>&lt;P&gt;I have the following scenario:&lt;/P&gt;
  &lt;P&gt;A form binded to an entityset, I'm using annotations and have some smartFields.&lt;/P&gt;
  &lt;P&gt;The fields have their valueHelp binded to an getEntity. The thing is that I need to pass some custom filters to my smartField after they fill some of the inputs, like when you filter a list :&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;var oFilter = new Filter({ path: "...", operator: FilterOperator.EQ, value1: '....'});

var oBindings = sap.ui.getCore().byId(".......").getBinding("items"); 
oBindings.filter([oFilter]);
&lt;/CODE&gt;&lt;/PRE&gt;This is how I bind my form:
  &lt;PRE&gt;&lt;CODE&gt;sap.ui.getCore().byId("form").bindElement("/TestSet('00')");&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;And my view:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;smartField:SmartField id="iSelectMotivo" value="{MotivoCrm}"&amp;gt;
     &amp;lt;smartField:configuration&amp;gt;
        &amp;lt;smartField:Configuration controlType="input" displayBehaviour="idAndDescription"/&amp;gt;
     &amp;lt;/smartField:configuration&amp;gt;
&amp;lt;/smartField:SmartField&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Any tips how can I archive this?&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;(Similar question &lt;A href="https://answers.sap.com/questions/32849/pass-filter-to-value-help-of-smartfield.html" target="test_blank"&gt;https://answers.sap.com/questions/32849/pass-filter-to-value-help-of-smartfield.html&lt;/A&gt;&lt;BR /&gt;none answerd, 1 year ago)&lt;/P&gt;
  &lt;P&gt;Thx in advance.&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 09:29:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smartfield-dependency-filter/qaq-p/640758</guid>
      <dc:creator>CristianBabei</dc:creator>
      <dc:date>2018-04-18T09:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: SmartField dependency filter</title>
      <link>https://community.sap.com/t5/technology-q-a/smartfield-dependency-filter/qaa-p/640759#M161152</link>
      <description>&lt;P&gt;Solved it.&lt;/P&gt;
  &lt;P&gt;Seems, all Smart Objects, have inside the proper component it uses, so for example in a SmartField type Select, it has a sap.m.select inside, and when you access this one, is the same as for all other components, get the binding context and then filter.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;_onCategoryChange: function(oEvent){
      var vValue = oEvent.getSource().getValue();
      var oFilter = new sap.ui.model.Filter({
                path: "Test",
                operator: sap.ui.model.FilterOperator.EQ,
                value1: vValue
      });
      //var oSubcategory   = sap.ui.getCore().byId('SFIESubcategory');    //This is the SmartField
      var oSubcategoryList = sap.ui.getCore().byId("SFIESubcategory").getContent();
      var oBinding         = oSubcategoryList.getBinding("items");
      oBinding.filter[oFilter];
},
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jun 2018 08:21:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smartfield-dependency-filter/qaa-p/640759#M161152</guid>
      <dc:creator>CristianBabei</dc:creator>
      <dc:date>2018-06-19T08:21:39Z</dc:date>
    </item>
  </channel>
</rss>

