113
Views
7
Comments
Solved
Add widget on change event of combo box
Question

Hi,


I'm using a combo box inside of a form which has a set of values. Now If I select a particular option, another combo box should get added to my form. 

I'm really stuck at that for quite long. Please help me out here. Thnx in advance. 

2018-11-14 14-40-27
Vincent Colpa
Solution

Hey

The easiest thing for you in my opinion is to put the second Combo Box in the form and set its visibility to "False".

When you select that option on the action associated to your Combo Box On Change event you add an If Statement with the condition if the option you want is selected then you set the visibility of the Combo Box to "True",


Cheers

VC

2019-09-24 18-41-25
Jorge Martins
 
MVP

Hi Neeraj,

Are you still stuck on this issue? Can you provide more info on what exactly you want to achieve?

2018-11-14 14-40-27
Vincent Colpa
Solution

Hey

The easiest thing for you in my opinion is to put the second Combo Box in the form and set its visibility to "False".

When you select that option on the action associated to your Combo Box On Change event you add an If Statement with the condition if the option you want is selected then you set the visibility of the Combo Box to "True",


Cheers

VC

UserImage.jpg
Neeraj Sharma

Thnx for your attentions guys. But I've already resolved it by injecting JavaScript.

2018-11-14 14-40-27
Vincent Colpa

Neeraj Sharma wrote:

Thnx for your attentions guys. But I've already resolved it by injecting JavaScript.


Hey,

careful because certain browsers or certain users may have the Javascript disabled. That may give you issues for example showing the Combo Box when you don't want or even the Combo Box not being shown at all. Have you tried disabling JavaScript while testing?


Cheers

UserImage.jpg
Neeraj Sharma

Hi Vincent,

Thnx for pointing it out but if it was so, many of outsystems plugins and widgets wouldn't work since those widgets are entirely dependent on javascript.

Thnx anyways, i'll take care of that.

2020-02-28 09-46-54
Eduardo Jauch

Hello Neeraj,

I would like to point just that injecting JavaScript/HTML should always be avoided whenever possible, between other things because make the application more difficult to scale, to maintain, etc.

Just for future reference, the approach Vincent showed is better on those aspects.

Cheers,
Eduardo Jauch  

UserImage.jpg
Neeraj Sharma

Hi Vincent and Eduardo,

Thanx for your suggestions. I'm on to making changes as suggested by vincent.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.