37
Views
1
Comments
Solved
Select all from dropdown
Question
Application Type
Reactive

Hi Community,

In the screen SelectAllfromDropdown, i have set up the following

  1. OnInitialize - I have assign local variable to be the input parameter of the screen
  2. GetCategories aggregate is only used to populate the dropdown list
  3. Dropdown widget
    • Has "Select All" in the empty text
    • OnChange event to refresh GetQuestionsByCategoryId aggregate
  4. GetQuestionByCategoryId has a filter which Questions.CategoryId = SelectedCategory (local variable)

This issue i have is that, the "Select All" is not working. Can anybody advise what had i done wrong here?

Thanks!

2022-07-11 14-05-36
Jeroen Barnhoorn
Solution

Hi Jun Mun,

The issue is that your aggregate will only return records where the category Id matches the selected category. In your case, your 'select all' option corresponds to category id = 0, so it will only return records for that specific category Id, rather than all categories. Try changing your aggregate's filter to:

Questions.CategoryId = SelectedCategory or SelectedCategory = NullIdentifier()

That way, when no category is selected, the filter will always evaluate to True, so all records are returned.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.