176
Views
14
Comments
Solved
combox change
Question

Image A

image B,

how to do it,?


when i select the gender custom automatically custom inbox showing 

image A and Image B example of my question how to do it??

UserImage.jpg
vikas sharma
Champion
Solution

Hi Hafiz,

Although Nikhil explained already. I created a demo for this. Its in ReactiveWeb, but concept will be same for other type of application as well.


Thanks.

Custom.oml
2020-01-31 12-59-29
Hafiz Shaheed

vikas sharma wrote:

Hi Hafiz,

Although Nikhil explained already. I created a demo for this. Its in ReactiveWeb, but concept will be same for other type of application as well.


Thanks.

thank you:) I will try  web traditional 


2020-01-31 12-59-29
Hafiz Shaheed

vikas sharma wrote:

Hi Hafiz,

Although Nikhil explained already. I created a demo for this. Its in ReactiveWeb, but concept will be same for other type of application as well.


Thanks.


m trying but no working and I attached  oml plz what I wong??

ComboTest.oml
2026-02-26 06-29-24
Rahul
 
MVP

Hi Hafiz,


You can use "onchange" action for this


when user select value from drop down or combo box than onchange action fire.

and this custom inbox take into in div set this visible property according variable (isShow) True or False.
when user select value from drop down check this value is custom than show this div else false.


Hope this will Help you.

Regard

Rahul Sahu

2023-03-06 14-13-20
João Domingos

Hello Hafiz,


Edit: To solve the visibility of fields problem, read the answer above, to customize the combobox, read mine.


First of all, create a class in your stylesheet, for this example we will use "custom-combo":


    .custom-combo{       

        border: 2px #00f solid;

    }



Assign an OnChange action to this combo box, on that action what you have to do is:

1 - Verify If combo box selected value is now "Custom"

2 - If so, run this javascript code ("RunJavascript" action, from HttpRequestHandler Module):

   "

   var element = document.getElementById('" + <ComboBox.Id> + "');    element.classList.add("custom-combo");

  "


Change <ComboBox.Id> for your combobox name .Id value

To remove the class, in case of the user changes his selection, use this snippet to remove your custom style:

     element.classList.remove("custom-combo");


This should solve your problem, if you have any aditional doubts please be my guest ;)


Kind Regards,

JD



UserImage.jpg
vikas sharma
Champion

Hi Hafiz,

For showing extra form fields in case of custom. You can simply put extra form fields in a container and assign visibility of this container to a boolean variable.

Then in Onchange of dropdown, check if selected value is "custom". If its custom then change the value of boolean variable to true, so container will be visible.

Thanks.

2020-01-31 12-59-29
Hafiz Shaheed

vikas sharma wrote:

Hi Hafiz,

For showing extra form fields in case of custom. You can simply put extra form fields in a container and assign visibility of this container to a boolean variable.

Then in Onchange of dropdown, check if selected value is "custom". If its custom then change the value of boolean variable to true, so container will be visible.

Thanks.

are you give me oml of this task


2020-03-01 17-52-33
Nikhil Gaur

Hafiz Shaheed wrote:

Image A

image B,

how to do it,?


when i select the gender custom automatically custom inbox showing 

image A and Image B example of my question how to do it??

Hi Hafiz,

As you are using treditional web app so you can create on container and add extra fields which you want to show on specific condition. Set your condition in Display property of the container like below

Gender = "Custom"

or  if you are using static entity

Gender = Entities.Gender.Custom

Here Gender is the variable set in variable property of combobox.

After this you have to create OnChange Event of the combobox and have to ajax refresh your container you created above. Without this step display contition will not work upon change in gender in traditional web apps.

UserImage.jpg
vikas sharma
Champion
Solution

Hi Hafiz,

Although Nikhil explained already. I created a demo for this. Its in ReactiveWeb, but concept will be same for other type of application as well.


Thanks.

Custom.oml
2020-01-31 12-59-29
Hafiz Shaheed

vikas sharma wrote:

Hi Hafiz,

Although Nikhil explained already. I created a demo for this. Its in ReactiveWeb, but concept will be same for other type of application as well.


Thanks.

thank you:) I will try  web traditional 


2020-01-31 12-59-29
Hafiz Shaheed

vikas sharma wrote:

Hi Hafiz,

Although Nikhil explained already. I created a demo for this. Its in ReactiveWeb, but concept will be same for other type of application as well.


Thanks.


m trying but no working and I attached  oml plz what I wong??

ComboTest.oml
UserImage.jpg
vikas sharma
Champion

Hi  Hafiz,

I checked the OML, everything is right. Only mistake seems that you are  not handling container visibility using a Boolean variable. Right now you have given it static true value. Instead of this, you need to use a boolean variable, which is "isVisible" in your case and also need to update value of this variable when user select "custom" from dropdown.

Thanks

2020-01-31 12-59-29
Hafiz Shaheed

can you give me screenshot because i cant OR you can change on my oml

2026-02-26 06-29-24
Rahul
 
MVP

Hi Hafiz,


see the below image, provide name for input which you want show and use ajax refresh at last


Hope this will help you.

Regards

Rahul Sahu

2020-12-15 19-38-29
João Ferreira

Hi there,


First of all, i must say that i'm starting to do my first steps with OutSystems.

I already follow some paths (congratulations to the team that provided that. THEY ARE GREAT for noobs like me) and now i'm starting to develop my very first module.

In this case, i want to build a dropbox that shows different containers in each option that the user chooses.

I follow the .oml that @Vikas Sharma shared, e created all variables, the action but isn't working. Also, i can't find any relation between the variable "TextVar" with the dropbox and i don't know if the action i built make any sense (or if it's good practice to create actions like this)

I uploaded the .oml that i'm working on.


Best regards

ComprasNacionais.oml
2020-12-15 19-38-29
João Ferreira

Sorry, i opened a new question about this here

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