Display a container only after the button is clicked .

Display a container only after the button is clicked .

  

hi,

Can anyone help me with this query?

Thanks

Hi Akanksha,


For that you should enclose the container in an if with the condition attached to a boolean variable (for instance, ShowContainer).

If you're working in mobile, you link the button to a client action and set the adequate value for the boolean to show / hide.

If you're working in web, you link the button to a screen action, set the adequate value for the boolean to show / hide and ajax refresh the if widget (you will have to give it a name, so you can attach it to the ajax refresh).


Hope it helps.

Hi,

1) Create a local Variable called isClicked and set to false.

2) Create an if statement and place the container that you want to appear in the true branch. The condition of the if should be the isClicked variable.

3) In the action flow of the button assign the isClicked variable to True.

4) Then just refresh the section of the screen that has the if statement.

This will display the container after the button has been clicked. 

Peter

Peter Travers wrote:

Hi,

1) Create a local Variable called isClicked and set to false.

2) Create an if statement and place the container that you want to appear in the true branch. The condition of the if should be the isClicked variable.

3) In the action flow of the button assign the isClicked variable to True.

4) Then just refresh the section of the screen that has the if statement.

This will display the container after the button has been clicked. 

Pet

Thank you for the reply

But How to refresh the section of the screen that has the if statement?

Hi Akanksha  Pandey,


Please refer the attached .oml solution.

-- Screen Local Variable (Boolean Type) and ShowContainer Button Action:

 

- ShowContainer = False (Local Variable Properties)


- MagicContainer within IF widget (Assing Name to the IF widget)

Button Action:

1) Assign ShowContainer = True

2) Ajax Refresh the IF widget

Hope you understood my implementation as well as explanation.


Kind Regards,

Benjith Sam

Akanksha Pandey wrote:

Peter Travers wrote:

Hi,

1) Create a local Variable called isClicked and set to false.

2) Create an if statement and place the container that you want to appear in the true branch. The condition of the if should be the isClicked variable.

3) In the action flow of the button assign the isClicked variable to True.

4) Then just refresh the section of the screen that has the if statement.

This will display the container after the button has been clicked. 

Pet

Thank you for the reply

But How to refresh the section of the screen that has the if statement?

Hi Akanksha, so continuing on from the steps above,

5)  Right click the if statement and click "enclose in container", then give this container a name so it can be located by the Ajax refresh.

6) Within the action flow of the button, after the variable is changed to true, placed a Ajax refresh and in the pop up that is displayed, select the container that was created in the previous step.

When the button is clicked that section of the screen with then be updated. 

Let me know if that helps

 


Hello Akanksha,

While others already gave you the answers, I would like to point that this is explained in the online training.
If you already did the online training, I would suggest to revisit it, or if you didn't, I would recommend you to take the online training or a live training, as this will speed up your OutSystems development skills.

https://www.outsystems.com/learn/

Cheers.