Clicking Button in Child Web block

Consider a situation where I am having a web block consisting of two buttons: "Okay" and "Cancel". Now this web block has been used in a parent screen twice inside two separate container.

What i want to achieve is, If i click the "Okay" Button in the first instance of the web block on the parent screen, the cancel button of the second instance of the web block should also get clicked automatically. The below given diagram illustrates the problem:

How can I achieve this?

Hi, I think you should use Notify or event (based on your OS version) in one block and https://www.outsystems.com/forge/component-overview/597/event-system to notify the other block. 

I'm guessing you don't have issues with notifying the parent of the button selected.

https://success.outsystems.com/Documentation/10/Developing_an_Application/Design_UI/Reuse_UI/Propagate_Changes_From_a_Block_to_the_Parent

The second part is easier.

The Notification Handler on parent will know which block was changed. That action will refresh both webblocks with a new input, setting the default value. The selected receives "Ok". The other receives "Cancel".


Or just check this article

https://success.outsystems.com/Documentation/10/Developing_an_Application/Design_UI/Reuse_UI/Pass_Data_Between_Blocks


Hi! 

Perhaps if you add a input variable that tells the preparation from the web block to optionally run the same code as one or other of the buttons.  Then when a button is clicked on an instance, refresh the "other" web block sending it the information of the part of the code to run.

just an idea. 

Regards

Graça