Refreshing web block in Common>Layout block

We are trying to add some dynamic header data that updates as users navigate through our system.   We have added a web block to the UI Flows> Common> Layout web block and it displays on our all screen in our web app as expected.   However, I'm unable to refresh the web block that resides in the Layout block once the screen loads.   


The only work around I have found is to redraw the entire page if we need to refresh that data, which is not optimal as only the header really needs to be refreshed.   Any suggestions?

Solution

Hi Josh,

Instead of adding it to the layout inclose it in a webblock that you can refresh. On the layout you can create a placeholder to put this webblock. And if you have a custom template you can make that all new screens have this webblock.

Regards,

Marcelo

Solution

Thank you, the placeholder works great.   Unfortunately when this app was created there was no template assigned so I assume I will have to go through each web screen and manually add the web block to the custom header placeholder?

Hi,

Unfortunately yes you need to add to the screens 1 by 1.

Regards,

Marcelo

Hi Josh

It may not be a good way, but you can do what you want.

I attached an oml file, so I want you to look inside, but briefly describe the points of the method.

1. Create a WebBlock that wraps the WebBlock (placed in Layout) that you want to refresh
2. Place a FakeNotifyWidget in a wrapped WebBlock and bind it with an Action that will perform an AjaxRefresh on the WebBlock you want to refresh
3. Place the wrapped WebBlock in the Layout
4. Use Layout If you want to refresh the WebBlock in WebScreen, use `RunJavaScript` instead of using AjaxRefresh to send a notification to the FakeNotifyWidget in step 2