How to model dropdown list for filtering table?
I have a webservice which provides me with a number of objects. Among others, each object carries an attribute "category".
I want to display the list of objects in a table. I want be able to filter the displayed objects according to their category. I want be able to choose the to be displayed category at runtime by selecting a category from a dropdown list.
Unfortunately, I have no idea of how to model this.
Is that possible at all? How can I do that? Anyway, I want to avoid calling the web service more than once!
You can model this.
I have created a sample model that shows how this works. In model I used a list filtered by color.
In order to do this you will need to use a Data Share that will hold the data returned by the service (so the service will not be called over and over again).
the Data Share will be connected to a filter and the filter will be connected to the table.
The filtering criteria will be dependent on a field in the model (in my model it is a drop down in the form "input".
In the form "input" there is a drop down which holds the list of colors.
the drop down also has an action called "filter_table". note that the line connecting the Data Share to the filter is triggered by the event "filter_table" meaning each time this event is triggered data will flow from the Data Share to the filter. Note the "" prefix to the action.
Here are some screen shots that may help understand the model:
[action on drop down|http://img401.imageshack.us/my.php?image=dropdownactionqh8.png]