How to Chain form elements together so the selection in one list box determines the values populating the other list box.
- Create the report fex.
- Create a new html form using HTML Layout Painter.
Add a PushButton to form
Select button element and right click to add a hyperlink
Change display text from ‘button’ to ‘Submit’
Click on New to get the following box
Select External Procedure for Action
Navigate to fex (report) you want to be ran when clicking on submit and select fex.
Select Window for Target Type – this tells WebFOCUS to open form in a window.
Select _blank for Target Name – this tells WebFOCUS to open a new Window & click OK
The &variables are now pulled into the form from the related fex. Their default Control Type will be ‘text box’ – change to ‘list box’ and change Parameter grouping options to ‘Do not create a form’. Click OK.
Now select your first list box then click on the Param tab in lower right corner.
Select Dynamic radio button the master file should automatically populate and so should the database field – if the field doesn’t then select it from the list.
Now select the next list box and the parameter tab and follow the same steps as directly above.
Now select the third element on the form – this one happens to be year – this one we are going to populate from a fex in our common folder in the domain we are working in. So, select the Dynamic radio button then select the Procedure radio button, click on the square button with the ellipsis in it navigate to common folder and select the fex you’ve created to populate that list box with – here we select degcyear then click Open.
To chain the College Code and the Degree Code list boxes together do the following:
While holding the control button down select the College Code list box and the Degree Code list box. Then click on the chaining button in the tool bar – chain link with a yellow plus sign to the left of it.
Save and run the html page. When you select a value from the College Code list box, the values should change in the Degree Code list box.
Note: The &variables in the fex being ran for the report must be the name of the database field for chaining to work.