WAM045 - A Dynamic Selector Dropdown list using a Select Field
Objectives
This example changes the implementation of the Dynamic Selector Dropdown list weblet for section code, by making use of a third field in the sections working list. The working list will now be defined as:
Def_List Name(#sectdd) Fields(#deptment #section #secdesc) Type(*Working)
The list of sections will now be built once only and the selector field (DEPTMENT) will enable the weblet to select the correct values to show, based on the value of field DEPTMENT. A response WebRoutine for the Dynamic Selector for SECTIONS is no longer required.
The Dynamic Selector weblet for field SECTION will now to be set up to only display values that match the selector field, DEPTMENT.
The list SECTDD will now contain all values from the table SECTAB. This technique works well if the total number of sections is small, as in this case. However, if the possible list of department codes and section codes is large (1,000's for example rather than 100's), then the solution implemented in exercise WAM040 will be a better solution. As usual there is a trade off to consider. Is it better to output all values of section to the web page once, or to refresh the list of sections every time the department code changes? Bear in mind that this second approach is itself efficient because it uses AJAX techniques to only refresh the sections list and not the whole web page.
To demonstrate this technique you will complete the following :
Step 1. Create WAM iiiDynamSelector – Dynamic Selector using Select Field
Step 2. Setup the Dynamic Selector Dropdown list for Sections
Before You Begin
You should complete all preceding exercises.