81
Views
3
Comments
Solved
How to change a value of a variable on a change of a web block?

Hi, guys!

I have a web screen and two web blocks. In this screen I have a variable Opcao (it means Option in Portuguese).

What I need to do is click on a button on the 1st web block and by clicking I want to modify the value of the variable and this would render the 2nd web block on this web screen that I have.

I've put these two web blocks inside the web screeen. As default the first one is shown, because the if confition that I enclosed it says "Opcao = 1", "True: show web block 1", and the default value of Opcao is 1.

The issue that I'm facing more especifically is that when I try to do this change on the screen action of the button, Opcao doesn't appear as an option to be selected.



Hope you can help me.


Best regards,

Eduardo Coelho

mvp_badge
MVP
Rank: #2
Solution

Hi Eduardo,

The scope of a Web Block is that Web Block, it doesn't have any access to the Variables of the Screen it's included in, as that can be any Screen, so design-time you don't know what Variables are available.

If you want Web Block 1 to trigger something in Web Block 2, you need to do that via the Screen they're both included on. So Web Block 1 should send a Notify (Platform 10) or an Event (Platform 11) to the Screen, and the Screen can react on that via a Screen Action, Ajax Refreshing Web Block 2, for example.

Rank: #2678

Thanks, Kilian!

I'm using platform 11, so I'll search for events and its features, how to use etc, as I haven't used yet.


Best regards,

Eduardo Coelho

mvp_badge
MVP
Rank: #2

You're most welcome! It's pretty easy to use (same as Events in P10 for Mobile), and a lot better than Notify :).