RunDataSource Use Examples
Basic RunDataSource Use
In this example we are going to be looking at a pair of drop down lists. What we want to achieve is that when the user selects an option from the material class list, the material type list below it should automatically update to show only the material types included in that class.
First we create both fields. The Material Class list just has options to select RAW or SCR. The Material Type list is being loaded from the datasource MaterialTypes shown in the image. Now we switch to AutoPostBack property of the Material Class list to on(Yes). You can see in the image we have added a process to the Material Class list. In this process we simply have the RunDataSource service that contains the ID for the ‘MaterialTypes’ datasource.
Effectively when the user changes the selection on the Class drop down list, this will trigger a postback and run the ‘MaterialTypes’ datasource. Inside this datasource we are checking for all the values that contain the term ‘(RAW)’ or ‘(SCR)’ in them. This is what is received from the MatClass field when the postback runs. Hence we get the effect of the MatType list being filtered on the selection made in MatClass.