Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
BalusC committed Dec 21, 2024
1 parent ea3319f commit e8c8f32
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.sun.faces.config.configpopulator;

import java.util.ArrayList;

import jakarta.faces.application.ApplicationConfigurationPopulator;
import jakarta.faces.component.UIColumn;
import jakarta.faces.component.UICommand;
Expand Down Expand Up @@ -355,15 +357,15 @@ private void appendChildElements(Document doc, String namespace, Element parentE

private void appendNestedChildElements(Document doc, String namespace, Element parentElement, String nestedElementName, String[] childElementNames, String[][] nestedChildElementValues) {
for (String[] childElementValues: nestedChildElementValues) {
var listenerElement = doc.createElementNS(namespace, nestedElementName);

appendChildElements(doc, namespace, listenerElement, new String[][] {
{ childElementNames[0], childElementValues[0] },
{ childElementNames[1], childElementValues[1] },
{ childElementNames[2], childElementValues[2] }
});

parentElement.appendChild(listenerElement);
var nestedElement = doc.createElementNS(namespace, nestedElementName);
var childElementNamesAndValues = new ArrayList<String[]>();

for (int i = 0; i < childElementNames.length; i++) {
childElementNamesAndValues.add(new String[] { childElementNames[i], childElementValues[i] });
}

appendChildElements(doc, namespace, nestedElement, childElementNamesAndValues.toArray(String[][]::new));
parentElement.appendChild(nestedElement);
}
}
}

0 comments on commit e8c8f32

Please sign in to comment.