Dropdown options disappear after selection

Hi,

I am a complete novice at coding and Corvid, so please keep that in mind when answering my question…

My problem:
I have a Repeater and a Dropdown all connected to a Collection (database?). I followed tutorials to link everything together and filter the repeater using the Dropdown. However, my issue occurs when I select a value from the Dropdown list. The page filters correctly, but I cannot filter a second time—when I click the Dropdown list again, the only option is the value that I selected initially.

My question:
How do I fix my Dropdown list so that, when I select a value the first time and my Repeater filters, I can continue to click the Dropdown and see the other filter options?

My code:

import wixData from "wix-data";

$w.onReady(function () {

});

export function industryDropdown_change(event) {
    $w("#caseList").setFilter(wixData.filter().eq("industry", $w("#industryDropdown").value));

}

My problem in pictures:

This is the default view on my page:

I can filter by any of my values in my database:

Here I select “Hosting” and the code filters my Repeater correctly:

However, now when I click the Dropdown, Hosting is the only option available, instead of the other values:

Greetings, it is possible to create another dataset tied to the same collection whose only use is to be the source of the dropdown list items. The repeater and its elements are still tied to the first dataset. The filter dropdown does not need to be connected to a dataset value.

Thanks for the reply, anthonyb. I have a few naive follow up questions:

  1. What is the difference between a dataset and a collection? I thought those were two words for the same thing.
  2. Every tutorial I’ve seen only uses one dataset and connects the repeater and dropdown to it and they don’t experience the same issue I do. Is it not possible that I’m doing some really basic thing incorrectly that can be fixed without trying to “hack” a solution by creating duplicate datasets?
  3. I’m not sure what you mean by this: “dropdown does not need to be connected to a dataset value”. This is what my dropdown connects to:

  1. A collection is the real repository of the data, whereas a dataset is a representation of that data for use with a page and its elements. For a thorough explanation see this page .

  2. Please include a link to the tutorials that you are referencing. There’s usually several ways to do a given thing. Perhaps I will be able to identify what you are not doing with the suggested approach. The fact remains, however, that the reason your dropdown is now limited to the industry that you just filtered on is that the dropdown list items and the page elements are connected to the same dataset called Startup_cases. You, in effect, just told Wix that you just want to see that industry for anything tied to that dataset.

  3. I connect values when I’m wanting to write to a dataset, which is not the case when using a dropdown to filter the dataset on a page.

  1. Got it.

  2. Got it.

  3. This is the tutorial which has the code snippet I used:
    https://www.youtube.com/watch?v=r0DLqkRDJ34&t=1084s

Note:
-You can see his code starting at 10:50
-His example uses 2 dropdowns. As you can see I only used the code for the first dropdown, labeled #brandDropdown in his example.
-One difference I just noticed is that he hardcodes his dropdown choices, while I connect mine to a list. Maybe that causes the issue?

Right, to avoid the problem with an approach different than what I suggested, you have to populate the dropdown either manually or through code. Connecting the list items to the same dataset that the form elements are tied to is the cause of the problem.