I have a combobox populated from a list and beneath that combo box I have a table of properties, associated with the selected item in the combo box.


I can populate the list fine, but I can't work out how to pull through the combo box value as a query filter & then refresh the table (the table is a widget so I could ajax refresh it).


Any thoughts?

Solution

When you create a combobox you need to attach a variable to save the selected value and you also have a OnChange property that you can bind into an screen action to do "Refresh Data" and the ajax refresh to the table.


You need to create a filter on your aggregate using something like this:

Session.MovieGenreFilter = NullIdentifier() or Movie.GenreId = Session.MovieGenreFilter


There's an exercise on the online training that guides you on how to do that.


if you are not implementing this way, can you share more details/pictures about how is your screen and your actions? I can try to help you more.

Solution

Hi Steve,

If you are capturing multiple values from combo box then you should take a boolean variable in supplied entity for each item. And if any item is selected its boolean value will be true. At last by iterating the list you can find out the values which are true/selected. 

Hi Vikas,

I think it is listbox who support multiple selection, not combo box.

Steve: Just follow below simple steps to do what you want.

  • In prepration of your screen add aggrigate to bind your table. Use screen local variable (which containes combo box selected value) as filter (as explained by lucas)
  • Define on change event for your combobox
  • Inside on change use refresh aggrigate
  • ajax refresh your table
  • you are done :)

I agree with Nikhil and that should be a solution. Please let us know if you still not got the point.