Skip to content
Permalink
Browse files

Explain how the previous item is handled when rendering form

Additionally avoid useless ‘Map#putAll’ invokation.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862227 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Jun 27, 2019
1 parent ae90412 commit b0c0ec7603eaad73614f0ce8f0220598fb36bfca
@@ -734,6 +734,7 @@ private void renderItemRows(Appendable writer, Map<String, Object> context, Form
int itemIndex = -1;
Object item = null;
context.put("wholeFormContext", context);
// Initialize previousItem with a sentry value since the first Item has no previous Item.
Map<String, Object> previousItem = new HashMap<>();
while ((item = safeNext(iter)) != null) {
itemIndex++;
@@ -763,8 +764,7 @@ private void renderItemRows(Appendable writer, Map<String, Object> context, Form

localContext.push();
localContext.put("previousItem", previousItem);
previousItem = new HashMap<>();
previousItem.putAll(itemMap);
previousItem = new HashMap<>(itemMap);

AbstractModelAction.runSubActions(modelForm.getRowActions(), localContext);

0 comments on commit b0c0ec7

Please sign in to comment.
You can’t perform that action at this time.