Composition Table to Refresh record after click Edit action from StandardEditor

Hi CUBA,

I’d like to confirm whether my coding is correct.

I have a one-to-many relationship at StandardEditor Screen

1.) Click Edit Action of Child Table
2.) Popup StandardEditor with Child Record then edit data
3.) Click OK

Child Record doesn’t refresh to composition table. However, the record has added into ParentDataContext modified Instances

Composition table would update if edit second times.

I have search around the forum for CUBA 7.2 and there is suggestion to use afterCommitHandler

E.g. childTableDc.replaceItem(child);

The above coding has solved my problem. Just want to confirm is it correct implementation

Regards,
CK

Hi,

It’s hard to say without looking at your code. Where do you call childTableDc.replaceItem(child)?

Hi Alex,

I call it at afterCommitHandler

@Install(to = “childTable.edit”, subject = “afterCommitHandler”)
private void childTableEditAfterCommitHandler(Child child) {
childTableDc.replaceItem(child);
}

Regards,
CK

Hi,

Any updates?

Regards,
CK

I’m afraid we need a test project with all related code to give you any recommendations.

Regards,
Konstantin

Hi Konstantin,

Noted. I will wait for your test project and recommendation.

Regards,
CK

Hi CK,

I mean we need a test project from you.
It’s a normal practice - you demonstrate a problem, we suggest a solution or make a fix if needed.

Regards,
Konstantin

Hi Konstantin,

I found the problem at my coding.

This is due to views at Child Record Popup doesn’t include parent entity. I’ve solved this by include parent entity at child popup views

Regards,
CK