cancel
Showing results for 
Search instead for 
Did you mean: 

Filters screen is working on first time but not working all the time

arumallaanusha
Explorer
0 Kudos

Hello,
Greetings of the day!
I am trying to use FilterBar control in my application. While clicking on filters button at first time I am getting filters dialog. when I am trying to click second time I am getting dump like below.

filter.png

Can anyone tell me how to solve this error
Thanks and best regards
Anusha

<VBox
   height="100%"
   fitContainer="true">
   <items>
      <fb:FilterBar
         reset="onReset"
         search=".handleShow"
         showRestoreButton="true"
         filterContainerWidth="17rem"
         showClearButton="true">
         <fb:filterGroupItems>
            <fb:FilterGroupItem
               groupName="g1"
               label="Partner"
               name="Partner"
               partOfCurrentVariant="true"
               visibleInFilterBar="true">
               <fb:control>
                  <g:shMultiOrgAll
                     id="Partner"
                     hideLoading="true"
                     modelName="oModel"
                     required="true"
                     disabledFilters="{SearchHelpProperties>/Partner/disabledFilters}"
                     path="/transactionPartner"
                     selectOptions="{SearchHelpProperties>/Partner/selectOptions}"
                     roleSelOptions="{SearchHelpProperties>/Partner/roleSelOptions}"/>
               </fb:control>
            </fb:FilterGroupItem>
            <fb:FilterGroupItem
               groupName="g1"
               name="period"
               label="{i18n>std.period}"
               partOfCurrentVariant="true"
               visibleInFilterBar="true">
               <fb:control>
                  <DateRangeSelection
                     width="100%"
                     id="period"
                     displayFormat="medium"
                     required="true"
                     value="{oModel>/period}"
                     change=".validatePeriodDates">
                  </DateRangeSelection>
               </fb:control>
            </fb:FilterGroupItem>
         </fb:filterGroupItems>
      </fb:FilterBar>
    </items>
</VBox>
arumallaanusha
Explorer

Accepted Solutions (0)

Answers (1)

Answers (1)

rohit_singhal
Active Contributor
0 Kudos

Hi Anusha,

Based on the screenshot shared by you, it looks like you might be destroying some controls while closing the Filter box. This is causing the issue to appear in second click.

Could you please share your controller code.

Best Regards,

Rohit

arumallaanusha
Explorer
0 Kudos

Hello Rohith
Thank you.
Related to controls used in FilterBar?

rohit_singhal
Active Contributor
0 Kudos

That's right

arumallaanusha
Explorer
0 Kudos
/**
 * Fill Company Code Select Options
 */
fillCompanyCodeSelectOptions() {
   let oView = this.getView();
   let oTurnoverModel = oView.getModel("oModel");
   let oCompanyCode = oView.byId("companyCode");
   oCompanyCode.destroyTokens();
   oTurnoverModel.setProperty("/companyCode", []);
   let aSelectOptions = [];
   let aTransactionPartner = oTurnoverModel.getProperty("/partner");
   if (aTransactionPartner.length) {
      _.forEach(aTransactionPartner, (oPartner) => {
         aSelectOptions.push({
            field: "SETTLEMENT_PARTNER",
            sign: "I",
            option: "EQ",
            value: oPartner.boId
         });
         aSelectOptions.push({
            field: "BO_TYPE",
            sign: "I",
            option: "EQ",
            value: oPartner.boType
         });
         aSelectOptions.push({
            field: "ROLE",
            sign: "I",
            option: "EQ",
            value: oPartner.role
         });
      });
   } else {
      aSelectOptions.push({
         field: "SETTLEMENT_PARTNER",
         sign: "I",
         option: "EQ",
         value: ""
      });
      aSelectOptions.push({
         field: "BO_TYPE",
         sign: "I",
         option: "EQ",
         value: ""
      });
      aSelectOptions.push({
         field: "ROLE",
         sign: "I",
         option: "EQ",
         value: ""
      });
   }
   oCompanyCode.setSelectOptions(aSelectOptions);
},
arumallaanusha
Explorer
0 Kudos

Here I Used destroy tokens only

arumallaanusha
Explorer
0 Kudos

When I click on third time I am getting error like

"Uncaught Error: Error: adding element with duplicate id '__bar3-adapt-filters-dialog'"