407
Views
5
Comments
Reactive: table with edit button open popup change data close popup update list
Question

Hi guys a question:

I have a screen and in that screen I have a list that I'm displaying in a table. On the table line I added a edit button. When clicking on that a popup opens and the data from that table row should be visible in a edit web block. In the web block the data can be changed and when pressing save the popup should close and the table record should be changed. Below the table is a save button to save all the data to the database.

So what I did was doing a input parameter on the web block of a record. Then when pressing save passing that record back by the event. Then change the current row of the table with the value from the web block. Only when I have 2 records and I change the second when the event returns the value from the web block the current row number is 0 instead of 1 so the first record is being updated.

Do you have any other idea on how to do this?

2023-09-28 14-21-55
Daryna Kravets

Hi,

Try to keep clicked row's number in screen parameter named like ClickedRowNumber. And when you want to update row after popup is closed you have to use TableRecord[ClickedRowNumber] row instead of TableRecord.Current.

I hope it will help.

UserImage.jpg
freek

TableRecord[ClickedRowNumber]  this is not something that can be used in a assign right?

2023-09-28 14-21-55
Daryna Kravets

freek wrote:

TableRecord[ClickedRowNumber]  this is not something that can be used in a assign right?

 

 Please check attached oml. It can be used in assign.

Sample.oml
2023-12-28 17-18-31
Praveen Kumar Natarajan
 
MVP

freek wrote:

Hi guys a question:

I have a screen and in that screen I have a list that I'm displaying in a table. On the table line I added a edit button. When clicking on that a popup opens and the data from that table row should be visible in a edit web block. In the web block the data can be changed and when pressing save the popup should close and the table record should be changed. Below the table is a save button to save all the data to the database.

So what I did was doing a input parameter on the web block of a record. Then when pressing save passing that record back by the event. Then change the current row of the table with the value from the web block. Only when I have 2 records and I change the second when the event returns the value from the web block the current row number is 0 instead of 1 so the first record is being updated.

Do you have any other idea on how to do this?

 

 Hi, 


instead you can check the correct record to update on the handler action( created in the parent)  as we can pass the edited row with its identifier from the webblock's event.  I have attached a sample oml file with this feature implemented for your reference. 

Thanks,

Praveen Kumar Natarajan

Tablewithedit.oml
UserImage.jpg
freek

Hi Praveen, in your example your working with data that is already stored in the database. In my case only at the end it's going to be stored in the database before it's just data in the screen. So I think your example is not suitable. :(

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