0

I just want to do in SmartDevices with Genexus two things, and I really cannot do it, thanks in advance if someone could help me.

1) Hide or show one field based on another field, eg: In edit mode show the field CITY only when the field COUNTRY is filled.

2) Hide empty fields when in view mode but show in the edit mode, this is possible if I create different layouts, but I want know if is possible do this with just one layout.

Thank you

Ricardo.

matiash
  • 54,791
  • 16
  • 125
  • 154

1 Answers1

0

You can use the ControlValueChanged event. For example.

Event &CountryId.ControlValueChanged
    If &CountryId <> ''
        &CityId.Visible = true
    Endif
EndEvent

Please note that for Edit controls, ControlValueChanged will fire when the edit loses focus, not when the user closes the keyboard. So you may want to use an Enter Event to make the second field visible too. This does not apply if CountryId is a dynamic combo, for example.

matiash
  • 54,791
  • 16
  • 125
  • 154
  • Don't know why the downvote to this answer. As of the second question it is possible if you create your own panel with every edit and view control on it, and handle the state yourself, say, through a variable. Wouldn't recommend it though – sebagomez Nov 11 '14 at 02:32