While working on the issue
OFBIZ-7252, I found one problem in Form Widgets. When we use <alt-target> attribute in child form, the system should consider overridden <alt-target> in child form. This is default expected behaviour. But in this case, it is always considering the <alt-target> of the parent form.
In above example, expectation is 'executeChildTarget' target should get executed but actually 'executeParentTarget' is getting executed.
When we looked into framework level code of Form Widgets, we got the following code snippets:
ModelForm.java (Line: 380-388)
Here we can see that all alt-targets present in parent form are added to the list first and then all alt-targets present in child form are added.
This causes a problem as method getTarget() of ModelForm.java (Line: 1352-1384) returns the first element in the list as alt-target.