How to select objects from the database in a dropdown?

I have a “Products” entity, associated with the “Category” entity as many-to-one (many products can belong to one category). When a new product is created, it is associated with the category using reference selector. On the page, I need to have a list widget to show products, and a dropdown, where I can select a category. When I select a category in the dropdown, I should see only products that belong to the selected in this list. I would be grateful for the idea of how to implement this dropdown. DataView widget can return only one object, while I need a full list of Categories. DataGrid widget shows all Categories in the grid instead of the dropdown. TemplateGrid widget is non-editable so the dropdown is not working.
1 answers

One option is using the datagrid.:

  • Set it’s Datasource to the entity Product.
  • In the searchbar add a new search-field by rightclicking and from the context menu selecting Add Searchfield → Dropdown
  • Select it, right-click and choose ‘Select attribute → Other’  and assign it to Product_Category/Category/Name