1716
Views
5
Comments
Changing visibilty of buttons on another button click
Question

Hi,

   I was doing the booking assignment exercise. I had a doubt that how can we make a button visible only after clicking another button. Also in case of a container, only after clicking a button it the container should show. It is said in the assignment 5 part 2 of that assignment.

Can anyone please help???


Thanks

mvp_badge
MVP
Rank: #19

Hi Devu,

You may want to consider using an IF widget to decide whether to show the second button or not (and maybe another one for the other container you mention?)... you just need to make sure whatever condition you use on the IFs will only evaluate to true after you click the first button (and will evaluate to false before)

Rank: #445

Hi Devu  Mani,

                     You can use the display:none Style, Please find the attached oml.


Thanks

Rajendra Singh

Display_none.oml

Rank: #452

Hi Devo Mani,


The solution provided by @Rajendra is totally correct But be careful since it only applies a CSS style that hides the container, the form is sent to the client anyways. The best option is to create a variable, a Boolean for example, which you can use to manipulate the display of any widget accordingly to your needs.


Quick and easy example:

  1. Create a Boolean variable and call it "ShowContainer" and set it by default to false;
  2. Click on your container and go to the display property and change it to  ShowContainer -> If the ShowContainer variable is set to true it shows the container otherwise it hides the container;
  3. On your Button Click action, assign the value of ShowContainer  to true.


And that's it, as simple as that.

Hope it helped !


Best Regards,

Diogo Romero



Rank: #27163

Romero wrote: u are a hero!

Hi Devo Mani,


The solution provided by @Rajendra is totally correct But be careful since it only applies a CSS style that hides the container, the form is sent to the client anyways. The best option is to create a variable, a Boolean for example, which you can use to manipulate the display of any widget accordingly to your needs.


Quick and easy example:

  1. Create a Boolean variable and call it "ShowContainer" and set it by default to false;
  2. Click on your container and go to the display property and change it to  ShowContainer -> If the ShowContainer variable is set to true it shows the container otherwise it hides the container;
  3. On your Button Click action, assign the value of ShowContainer  to true.


And that's it, as simple as that.

Hope it helped !


Best Regards,

Diogo Romero





Rank: #13553

Hey! I was with the same problem but for me the things that I have to set Invisible or Visible are Containers with Links. So, now my question is, How do I do the "If" part? And Where? How do I define the variable "ShowContainer" True or Flase?

Capturar.PNG