Dynamic Form

  

Hi everyone. I need help. I'm using the latest version of the Platform.

Initially when the form is loaded, the Custom Demo Date field is hidden.


But as soon as the User selects "YES", the Custom Demo Date field should Display. And if the User selects "NO" I'd like to hide the field gain.

How can I best implement this...? I'd really appreciate the assistance on this.


Best Regards.

Solution

Hi Sthamza,

The combo box Custom Demo date needs to have a boolean variable that turns that container visible of invisible depending on the variable. After that onChange of the combo box Custom Demo Required you add an action that check the value of this combo box and if it's yes change the boolean variable that controls the other combo visibility accordingly. After that just do an ajax refresh to the container.

Hope this helps.

Regards,

Marcelo

Solution

Hello

To make it simple, I would change the combo box to a Check Box. It is associated with a boolean variable. Use this variable in the condition of the IF that shows/hide the element. Set a Screen Action in the OnChange of the Check Box and just do an Ajax Refresh in it, in the IF (it requires a name).

Cheers.

Eduardo Jauch wrote:

Hello

To make it simple, I would change the combo box to a Check Box. It is associated with a boolean variable. Use this variable in the condition of the IF that shows/hide the element. Set a Screen Action in the OnChange of the Check Box and just do an Ajax Refresh in it, in the IF (it requires a name).

Cheers.

Thanks Eduardo. I like the Check Box suggestion. I'll play around with it.

Is there a good way to do this in OutSystems without needing a server action to refresh the content of the page? It seems to me that it is unnecessary performance overhead to have to make a call to the server to make a DOM update based on client behavior.

Hi Grayson,

The only way of doing it without a server call is with javascript. You can add a specific classes to those elements and code the behaviour you want.

Regards,

Marcelo