35
Views
7
Comments
Solved
WebBlock
Question

Hi Guys!

I have a parent WebBlock "WebBlock 1" that sends data to the child WebBlock "WebBlock 2", but I have a delete and save button that is in the parent WebBlock but the information that I need to save or delete are inputs that are edited by the user and these inputs are in the child WebBlock, I don't know how to return this data because I can have up to 100 entries because they are in a list and I have no way to put them an event for the inputs.

WebBlock needed to be dynamic and the list return a format that I tried other ways but it is a list within another list and in this case only the second list would be edited.

I apologize for sending prints because it's the company's project.

2019-01-07 16-04-16
Siya
 
MVP
Solution

I'll explain your requirement with an example as I understand it. WebBlock 1 sends a list of employees with attributes like Id, Name, and Date of Hiring to WebBlock 2. In WebBlock 2, the employees are displayed, allowing users to update an employee’s Name or remove an employee. When the Save button is clicked in WebBlock 1, it needs to determine which employee records have been modified or removed. Based on this I propose the following.

One possible solution is for WebBlock 2 to raise an event with the updated list of employees. WebBlock 1 keeps a local copy of the original list and maintains a modified version of the list as changes occur. When the Save button is clicked, WebBlock 1 compares the original list with the modified list to identify changes and take the necessary actions. This approach is straightforward but requires maintaining three copies of the data: the original list, the modified list in WebBlock 1, and the active list in WebBlock 2.

Another option is for WebBlock 2 to raise two separate events: one when an employee's details are modified, passing only the updated employee record, and another when an employee is deleted, passing just the primary key of the removed record. WebBlock 1 then maintains two separate lists, one for modified employees and another for deleted records. When Save is clicked, WebBlock 1 processes these lists to apply the necessary updates. This method is more efficient as it avoids unnecessary duplication and tracks only the required changes dynamically.

2026-02-16 05-51-10
Sahana K

Hi Fabiano Ferreira ,
To return the modified data from WebBlock 2 to WebBlock 1, used an event: 
1.Define an Event in WebBlock 2:
Create an event (OnChange) in WebBlock 2 to send the updated list back to WebBlock 1
2.In WebBlock 2, define an event to send the updated list back to WebBlock 1.
3.Store Edited Data in a Local Variable in WebBlock 2
4.Trigger the Event on Save/Delete  
5.Handle the Event in WebBlock 1 

Thanks,
Sahana

UserImage.jpg
Duraikannan Kandasamy

Hi @Fabiano Ferreira 

I understand your requirement that you have list of record (Data) in Child block, and you have save or delete button in Parent Block for saving function you need those data...Its correct right?

To achieve 

  • Create a Handler in Child block that need to have the List as an Input Parament.
  • That event needs to trigger when the any changes happen in the list inside Child block. (eg: Appending value to the list or removing value to the list. after these actions you need to trigger the event and pass the list to the input parameter of the Event)
  • For this event you to handle it in Parent Block. for that create a Local variable as same as the list inside the child Block and in that Event Handler assigns the Input parameter of the Event and Local list in the Parent block.
  • So, you can manage those data inside the Local variable in the Parent Block and use that in the save or delete functionality.

Try this method and let me know whether it helpful for your requirement or not.

Thank you,

Duraikannan.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi,

It looks like you try to implement a grid pattern using a list of blocks. This is hard to implement and keep it performance because yo need to firing of a lot of events.

Consider using the outsystems Grid, or other Grid Forge components, that already imement he behaviour you now try to built yourself.

Regards,

Daniel

2022-12-30 07-28-09
Navneet Garg

Aggreged with  @Daniël Kuhlmann, you should try grid. Managing too many blocks is very complex.

You need to be very careful else it will be a performance problem for the application.



2024-07-09 07-02-02
Mukul Singh Nathawat

Hi Fabiano Ferreira,

Hope you are having a good day.

Seems what you are trying to implement is already there as forge component in outsystems.

you can learn more about this here:
https://www.outsystems.com/forge/component-overview/9764/outsystems-data-grid-o11

This is a outsystems supported asset so you can integrate it with your app without any issues. you will also find many docs on how to use it.
if what you are trying to build is different then you can create a discussion where we would love to help you more.

Cheers,

Mukul Singh Nathawat

UserImage.jpg
Fabiano Ferreira

Thanks guys!

I started the project, this grid format had already been developed and I needed to deliver the project on Friday, so I chose to create the lists and events in onchange, always keeping the list updated in both blocks, I know it takes a greater toll on performance, then I'll check a grid in forge to improve.

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