610
Views
8
Comments
Webblock

Dear All

There are two blocks inside the screen, Data is saved on 1st block and list is appeared in second block How to refresh the second block 


Thanks 

Jitesh

2021-10-09 07-57-44
Stefan Weber
 
MVP

Hi,

i block rerenders whenever an input parameter changes. In case you do not have any data for the second webblock to pass in thus rerendering the block you could simply add a new boolean Input paramter to your block (eg. Toggle).

Bind that input parameter to a local variable of your screen.

In your webblock one add an event which you raise after saving the data.

In your screen handle the event and assign set your screen boolean value. e.g.. LocalToggle = not LocalToggle.

In your webblock 2 you can add an OnParametersChanged event to refresh data asf.

Best

Stefan

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Stefan,

Note that in order to re-render, you must handle the On Parameters Changed, or else nothing happens!

2021-10-09 07-57-44
Stefan Weber
 
MVP

sorry. yes you are right, it should read you must add an OnParametersChanged event to refresh data asf.

2023-06-06 15-46-39
Jose Guzman

Thanks for your help, there are the steps to use this solution.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

You could have the first block send an event to the screen, and then have the screen refresh the second block by changing one of its input parameters, handling the On Parameters Changed of that block by refreshing the query. Since there's not a change in any real parameter, you must add some dummy parameter that you update (some counter, or a date/time or whatever).

I searched the forum to see if there's not a better way, but it seem there's not.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

I just saw there's an Idea for this, so go upvote it :).

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
2023-10-21 19-42-11
Tousif Khan
Champion

Hello @Jitesh 
As mentioned in above comments, I will explain you about it by taking some examples
First we will come to blocks

Blocks
If we want to Pass a Value from Block to Parent(parent can be another block or screen), the we create a Event on a Block that will behave as a medium and will help us to pass a value from Block to its parent.
And When we have to pass any value from Parent to Block, in that case we will pass the value by taking Input parameter on a block and we will pass the value from the parent where the block is used,

Now Lets Come to your scenario

  • You have two blocks which have same parent(screen).
  • Suppose Block A have Form, from which you are saving data,  and On Block B You are Showing Data in a table or List.
  • On Block A Create a Event And Take a Input Parameter on your Event, In your case we can take it as Identifier.
  • Now when you click the save button on your from, your action will run and create the data. Once the create operation is performed you need to use the event on you flow, you can pass the  Created ID to your Event.
  • Then when we come to parent where we have to take the value from block and store it temporary, 
  • Here On you parent screen you need to create a handler,  that will help us to take the value which is passed from block and store in a variable on a screen.(you need to use assign here)
  • So here your Work is done with block A and parent.
  • Now On block B we have to create a OnParameter change Block Event that will help us to refresh the data, so that the new inserted data will be displayed.
  • So from the screen we will pass the local variable that store the  value that we have got from bock A, we will pass that. 
  • Whenever the value of your Block A input parameter will change your OnParameter will be triggered and inside that your aggregate will be refreshed.

I hope you will have understood, by this example
I am also attaching a Demo for you that might also help.
Sample Demo

Best Regards
Tousif Khan

DemoApplication_Blocks.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.