770
Views
5
Comments
Solved
How to refresh block when event is triggered from different block.?
Application Type
Reactive
Service Studio Version
11.54.4 (Build 62290)

Hi, 

I have one block where I call the API, and then that data from the API is showed in grid which is placed in different block. 

above is the image of my screen... where the GET button in left pane is fetching the data and showing that data in right pane grid.

Now, when I click that get button again, the data is appended again, I want whenever the Get button is clicked, the screen restored to its start version.

2023-03-16 04-58-56
Ashish Lonkar
Solution

Hi Keshav,

Add an input parameter to the block where u r displaying data and also add OnParameters change action in this block. Whenever u click the GET button make sure update/toggle the value this input parameter. This way u can refresh the block data everytime via the OnParameters change action.

Hope u understand what I am trying to say, if u want me to implement this for u please share ur OAP.


Thanks AWL!

UserImage.jpg
Keshav Raghav

Thanks it worked.

UserImage.jpg
Kay Lun
Solution

Hi Keshav,

On top of what @Ashish Lonkar said, there's still something missing, I will list what you need in the below

  1. Block 1, need an input parameters created from the parent screen which used to display the data. (Optional) OnParameterChange action is needed if the display data need to fetch from aggregate or data from any server actions
  2. Block 2, need an event with input parameters that will be triggered when the data set selected in Block 2
  3. Parent Screen, need an screen action handler to receive the the data from the event of Block 2, and assign to the input parameters that used in Block 1

Then you will have a block re-render every time the input parameters change.

Hope this help.


UserImage.jpg
Keshav Raghav

Thanks for brief explanation. It worked.

https://www.outsystems.com/forums/discussion/88029/is-there-any-way-of-load-unload-different-blocks-on-same-screen/

Highly appreciated if you can help me out in this.

2024-10-07 06-43-19
Aanchal Sharma

hi @Keshav Raghav 

can you please provide some more detail exactly what you want.

is data repeated ? that's the problem

or you want to refresh block?

little bit clearance so I can help you.

2023-03-16 04-58-56
Ashish Lonkar
Solution

Hi Keshav,

Add an input parameter to the block where u r displaying data and also add OnParameters change action in this block. Whenever u click the GET button make sure update/toggle the value this input parameter. This way u can refresh the block data everytime via the OnParameters change action.

Hope u understand what I am trying to say, if u want me to implement this for u please share ur OAP.


Thanks AWL!

UserImage.jpg
Keshav Raghav

Thanks it worked.

UserImage.jpg
Kay Lun
Solution

Hi Keshav,

On top of what @Ashish Lonkar said, there's still something missing, I will list what you need in the below

  1. Block 1, need an input parameters created from the parent screen which used to display the data. (Optional) OnParameterChange action is needed if the display data need to fetch from aggregate or data from any server actions
  2. Block 2, need an event with input parameters that will be triggered when the data set selected in Block 2
  3. Parent Screen, need an screen action handler to receive the the data from the event of Block 2, and assign to the input parameters that used in Block 1

Then you will have a block re-render every time the input parameters change.

Hope this help.


UserImage.jpg
Keshav Raghav

Thanks for brief explanation. It worked.

https://www.outsystems.com/forums/discussion/88029/is-there-any-way-of-load-unload-different-blocks-on-same-screen/

Highly appreciated if you can help me out in this.

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