ckwan
(Choon Kit Wan)
#1
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
krivopustov
(Konstantin Krivopustov)
#2
Hi,
It’s hard to say without looking at your code. Where do you call childTableDc.replaceItem(child)
?
ckwan
(Choon Kit Wan)
#3
Hi Alex,
I call it at afterCommitHandler
@Install(to = “childTable.edit”, subject = “afterCommitHandler”)
private void childTableEditAfterCommitHandler(Child child) {
childTableDc.replaceItem(child);
}
Regards,
CK
krivopustov
(Konstantin Krivopustov)
#5
I’m afraid we need a test project with all related code to give you any recommendations.
Regards,
Konstantin
ckwan
(Choon Kit Wan)
#6
Hi Konstantin,
Noted. I will wait for your test project and recommendation.
Regards,
CK
krivopustov
(Konstantin Krivopustov)
#7
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
ckwan
(Choon Kit Wan)
#8
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