Skip to content

Commit

Permalink
Fixed: bug in which fields of a form do not sort if it has a parent
Browse files Browse the repository at this point in the history
The ModelForm.java is using an incorrect parameter name for sorting if a form
extends from another form. This fixes it by using the correct parameter name.

Thanks: Gil Portenseigne for reviewing and providing a better implementation


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1851426 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
pythys committed Jan 16, 2019
1 parent b7132c1 commit df59ff8
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,11 @@ protected ModelForm(Element formElement, String formLocation, ModelReader entity
lastOrderFields.addAll(parentModel.lastOrderFields);
}
String sortFieldParameterName = formElement.getAttribute("sort-field-parameter-name");
if (sortFieldParameterName.isEmpty() && parentModel != null) {
this.sortFieldParameterName = parentModel.targetType;
} else {
this.sortFieldParameterName = "sortField";
}
if (!sortFieldParameterName.isEmpty()) {
this.sortFieldParameterName = sortFieldParameterName;
} else {
this.sortFieldParameterName = (parentModel != null) ? parentModel.getSortFieldParameterName() : "sortField";
}
String defaultRequiredFieldStyle = formElement.getAttribute("default-required-field-style");
if (defaultRequiredFieldStyle.isEmpty() && parentModel != null) {
defaultRequiredFieldStyle = parentModel.defaultRequiredFieldStyle;
Expand Down

0 comments on commit df59ff8

Please sign in to comment.