Step 2 Make Radio Buttons Show and Hide Fields

Visual LANSA

Step 2. Make Radio Buttons Show and Hide Fields

FRM065 - Using List Components

In this step you will create Click events for the radio buttons to make the required search by field visible.

1.  Create a Click event for RDBN_1.

2.  Add logic to make iiiSRCNME visible and hide fields iiiSRCDEP and iiiSRCDTE. Your code should look like the following:

* Surname search

Evtroutine Handling(#RDBN_1.Click)
#iiiSRCNME.visible := true
#iiiSRCDEP.visible := false
#iiiSRCDTE.visible := false
Endroutine

 

3.  Create Click events for RDBN_2 and RDBN_3. Copy and paste the code from the RDBN_1.Click event into each routine and carefully modify the code as required.

     Tip: As you have not renamed the radio buttons, it is a good idea to add a comment above each click event defining which search this is.

4.  Compile and test your form. Clicking on each radio button should show one field only.