Avatar

Level 10

Hi,

It is possible, but will require a little script.

LC Designer ES2 does have an Action Builder under the Tools menu, but I can't remember if it was in LV Designer v8.2. Action Builder would make it a little easier to get this working, as you would set out what you want in plain English and LC Designer would build the script for you.

Okay, first there is an example here that shows how to access and change the ".presence" property. This is what you need to work with when make something visible/invisible.

http://assure.ly/h7whb8

There are a couple of options:

  1. You can set the subform's presence to "visible" - does what it says on the tin - the user can see the subform.
  2. You can set it to "invisible" - here the user can't see the subform, but it still takes up space on the form (this is important if the container is set to Flowed).
  3. You can also set it to "hidden". This is like invisible, as the user can't see the subform. But in addition the subform does not take up space and the rest of the object beneath can move up to take its place (in a Flowed layout).

For the time being don't worry about Positioned (default) or Flowed layouts.

For most objects on a form, you can write script against a number of different events. For example, click, enter, exit, etc. IF you open the Script Editor and make it a few lines long (drag the bottom bar), you will see that you can select an event from the dropdown at the top and also select a language. The example and the script below are JavaScript and in the click event.

LC Designer workspace.png

Let us say that the subform is called "yourDetails" and that the radio buttons have specified values "Yes" = 1 and "No" = 0 (select the radio buttons and go to the Object > Binding palette).

Now the following script in the click event:

// this is a test to see what the value of the radio button is

if (this.rawValue == 1)

{

     // if the radio button is 1 (eg Yes) then show the subform

     yourDetails.presence = "visible";

}

else

{

     // there is no need to test here. if the radio button is not Yes it must be No, therefore hide the subform

     yourDetails.presence = "invisible";

}

Hopefully this will get you out of the traps,

Niall