diff --git a/framework/widget/dtd/widget-form.xsd b/framework/widget/dtd/widget-form.xsd
index 606063871a..18f327462a 100644
--- a/framework/widget/dtd/widget-form.xsd
+++ b/framework/widget/dtd/widget-form.xsd
@@ -1317,6 +1317,13 @@ under the License.
+
+
+
+ The name of the parent form, needed when using skip-start="true" along with correct id-name value on field
+
+
+
diff --git a/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java b/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java
index 561e1f7b88..921f4166f3 100644
--- a/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java
+++ b/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java
@@ -2761,6 +2761,7 @@ public class ModelFormField {
private final String descriptionFieldName;
private final String fadeBackground;
private final FlexibleStringExpander formName;
+ private final String parentFormName;
private final String initiallyCollapsed;
private final String lookupHeight;
private final String lookupPosition;
@@ -2772,6 +2773,7 @@ public class ModelFormField {
public LookupField(Element element, ModelFormField modelFormField) {
super(element, modelFormField);
this.descriptionFieldName = element.getAttribute("description-field-name");
+ this.parentFormName = element.getAttribute("form-name");
this.fadeBackground = element.getAttribute("fade-background");
this.formName = FlexibleStringExpander.getInstance(element.getAttribute("target-form-name"));
this.initiallyCollapsed = element.getAttribute("initially-collapsed");
@@ -2788,6 +2790,7 @@ public class ModelFormField {
this.descriptionFieldName = "";
this.fadeBackground = "";
this.formName = FlexibleStringExpander.getInstance("");
+ this.parentFormName = "";
this.initiallyCollapsed = "";
this.lookupHeight = "";
this.lookupPosition = "";
@@ -2802,6 +2805,7 @@ public class ModelFormField {
this.descriptionFieldName = original.descriptionFieldName;
this.fadeBackground = original.fadeBackground;
this.formName = original.formName;
+ this.parentFormName = original.parentFormName;
this.initiallyCollapsed = original.initiallyCollapsed;
this.lookupHeight = original.lookupHeight;
this.lookupPosition = original.lookupPosition;
@@ -2866,6 +2870,10 @@ public class ModelFormField {
return targetParameter;
}
+ public String getParentFormName() {
+ return this.parentFormName;
+ }
+
public List getTargetParameterList() {
List paramList = new LinkedList();
if (UtilValidate.isNotEmpty(this.targetParameter)) {
diff --git a/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java b/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java
index c0df0871ae..26934332f4 100644
--- a/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java
+++ b/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java
@@ -2068,7 +2068,10 @@ public final class MacroFormRenderer implements FormStringRenderer {
// add lookup pop-up button
String descriptionFieldName = lookupField.getDescriptionFieldName();
ModelForm modelForm = modelFormField.getModelForm();
- String formName = FormRenderer.getCurrentFormName(modelForm, context);
+ String formName = lookupField.getParentFormName();
+ if (UtilValidate.isEmpty(formName)) {
+ formName = FormRenderer.getCurrentFormName(modelForm, context);
+ }
StringBuilder targetParameterIter = new StringBuilder();
StringBuilder imgSrc = new StringBuilder();
// FIXME: refactor using the StringUtils methods