SAP/openui5 — pull request #213 by esjewett (2014-11-04 17:28:05+00:00)
Title: Fix ux3 facet filter example when switching a facet from one active filter to another

I hereby declare to agree to the OpenUI5 Individual Contributor License Agreement

A couple of comments on this change:

To recreate the issue prior to application of this pull request, load up the ux3 FacetFilter demo, click on Car Model "325i", then click on Car Model "320d". At this point the "Type" facet list only contains "Limousine" but it should contain all three types that exist under model number 320d. This happens because the calcFilter function only considers values that appear in the facet under the current filter, but this logic is not correct in the event that a filter is changed from one value to another. In this case, we must consider all possible values of the facet.

This change is a bit of a hack, but unfortunately it doesn't appear there is a good way to access the unfiltered values of a model. If we could do this, then we could have the calcFilter function use those values and would not need to remove and re-apply the filter.

In general, I recommend using libraries designed for coordinated filtering and not writing this code on a one-off basis, as exactly this type of issue occurs often and library implementations will usually be more efficient. Libraries like Crossfilter are a good option. It make sense to mention this as an option in the example description in addition to mentioning the possibility of server-side processing.