How to Achieve communication from a nested web block to a screen

How to Achieve communication from a nested web block to a screen

  

Hi,

I have a web block with a notify action which is on another parent web block and both the web blocks are on a screen. Now when I'm trying to send a message from a web block which is inside another (Parent ) web block to a screen, I am not able to fetch the message on OnNotify action of the screen? Any suggestion on how to pass data from a web block inside a parent web  block to a screen?

Hi Shashankit Thakur,

You will have to daisy-chain the notification handling of your web blocks. 

Consider you have two Web Blocks A and B. You place an instance of Web Block A inside Web Block B (call it instance A1). Consider also that you have a Web Screen C, and you place an instance of Web Block B on that screen (call it instance B1).

  1. Web Block A uses the Notify action, and this will force the OnNotify to show on instance A1.
  2. Web Block B will need to provide a screen action OnNotifyHandlerForA1 to handle it.
  3. Inside OnNotifyHandlerForA1, Web Block B uses the Notify action to "bubble up" the notification to its own parent. Make sure you use the NotifyGetMessage action to receive the message first and use its return value as input parameter to the Notify action.
  4. This will force the OnNotify to show on instance B1;
  5. Web Screen C will need to provide a screen action OnNotifyHandlerForB1 to handle it.
  6. Inside OnNotifyHandlerForB1, Web Screen C will be able to fetch the message by using NotifyGetMessage.

Hope this helps!