cancel
Showing results for 
Search instead for 
Did you mean: 

ComboBox not working in FilterBar

ibibhu
Product and Topic Expert
Product and Topic Expert

Dear Community ,

In this scenario am using a ComboBox inside a filter bar

<fb:FilterGroupItem groupName="__$INTERNAL$" name="B" label="Region"partOfCurrentVariant="true" visibleInFilterBar="true">
	<fb:control>
	  <ComboBox type="Text">
		<items>
		  <core:Item key="001" text="EMEA"/>
		  <core:Item key="002" text="America"/>
		  <core:Item key="003" text="APJ"/>
		</items>
	  </ComboBox>
	</fb:control>
</fb:FilterGroupItem


The above scenario works in filter bar



And also in the filters popover


But when I changed this to a oData model

<filterbar:FilterGroupItem groupName="__$INTERNAL$" name="B" label="Region" partOfCurrentVariant="true" visibleInFilterBar="true">
	<filterbar:control>
	   <ComboBox items="{ path: '/Statuss'}">
		<core:Item key="{Key}" text="{Text}"/>
	   </ComboBox>
	</filterbar:control>
</filterbar:FilterGroupItem


The above scenario works in filter bar

But it's not working in the filters popover

In the above scenario am using the standard filter bar control. FilterBar Sample
SAP UI5 Version :1.82.4

Can anyone help on this .

Regards,
Bibhu

Accepted Solutions (1)

Accepted Solutions (1)

GregMalewski
Contributor

Hi Bibhu,

Looks like the issue with that control in the latest UI5 library. You can see here that it is working all right with 1.71.26:

https://plnkr.co/edit/NjuhEElPzdsATJSL

When you change the lib to 1.82 it stops working.

Regards

Greg

ibibhu
Product and Topic Expert
Product and Topic Expert

Thank you for the quick response @grzegorz.malewski.

Yes you are correct, the same thing works till version UI5 1.81

But in the new version 1.82 this issue is there.

Special Thanks to daniel.nanovski who helped me here in this case with a workaround
to set the model of the Combo box directly from the controller.

// Solution 1 - set the model directly on the ComboBox control
this.byId("ComboBox").setModel(oModel);
				
// Solution 2 - Set the model on the view but also propagate it to the
// ComboBox control when the dialog is about to open
// this.getView().setModel(oModel);
// this.byId("FilterBar").attachFiltersDialogBeforeOpen(function (oEvent) {
// this.byId("ComboBox").setModel(oModel);
// }.bind(this));


But the above issue is a known issue and I guess it was already fixed in the UI5 >1.83

It's really good to see multiple people from different region country collaborating together to solve a issue,

Thanks and Regards,
Bibhu
keep coding and keep helping #UI5

GregMalewski
Contributor

Hi, Thanks for sharing the workaround. Regards Greg

Answers (0)