I initialize it by creating a list with two empty records.
In the web block I have the form referring to a single record.
When saving, I need to return both records (which are lists with a single record) in a list and display the data of each of them in a message.
In case you get confused, the OML is pretty small, just parent screen and block. I've wasted hours trying to solve this, any help is welcome!
Hello Turta,
Hope you're doing well.
So I was checking your code and I found out a couple things, let me share them with you.
If you want to pass data between the Block and Parent Screen, you should indeed use Events.
However, you're triggering your event SetData in OnParamatersChanged action. But OnParametersChanged is an event that is only triggered when the input values of the Block change.
Since you're always passing the value True in the Boolean input, this action OnParametersChanged is never triggered (because input values are not changing), that's why the SetData event is not triggering as well.
Anyway, my suggestion is that you use the OnChange events associated to the inputs of your form to trigger the SetData event. Everytime there is a change in your form, you call an action (let's call it OnChangeInputs) and you trigger the SetData event in this action:
OnChangeInputs client action:
Back to your parent Screen, you need to have an Handler for this Block's event, which you have: SalvarOnClick.
These changes should trigger this action, where you can perform the logic that you pretend.
OML follows in attachment. Please consider that I removed some unnecessary things like the IsSave variable, Boolean input and OnParametersChanged event.
Hope that this helps you!
Kind regards,
Rui Barradas
Hi Turta,
In addition to Rui's response, a slight different solution would be..
Required Code Changes:
Note that you will only see the last record as the Feedback message, as it is called in a For Loop. I guess, the reason for using the Feedback message in your case, is to confirm the changes in the Local Screen List variable value w.r.t the block record changes?!
Demo Screen: ParentScreen
Refer to the attached oml
I hope this helps you!
Benjith Sam