Skip to content

Commit

Permalink
Fix #179: support nested UIData in Ajax#updateRow()
Browse files Browse the repository at this point in the history
Should cover a.o <p:columns>
  • Loading branch information
Bauke Scholtz committed Nov 5, 2015
1 parent 034ede3 commit b6e10dd
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/main/java/org/omnifaces/util/Ajax.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,20 @@ private static void updateRowCells(UIData table, int index) {
Collection<String> renderIds = getContext().getRenderIds();

for (UIComponent column : table.getChildren()) {
if (!(column instanceof UIColumn)) {
continue;
if (column instanceof UIColumn) {
for (UIComponent cell : column.getChildren()) {
renderIds.add(String.format("%s%c%d%c%s", tableId, separator, index, separator, cell.getId()));
}
}

for (UIComponent cell : column.getChildren()) {
renderIds.add(String.format("%s%c%d%c%s", tableId, separator, index, separator, cell.getId()));
else if (column instanceof UIData) { // <p:columns>.
String columnId = column.getId();
int columnCount = ((UIData) column).getRowCount();

for (UIComponent cell : column.getChildren()) {
for (int columnIndex = 0; columnIndex < columnCount; columnIndex++) {
renderIds.add(String.format("%s%c%d%c%s%c%d%c%s", tableId, separator, index, separator, columnId, separator, columnIndex, separator, cell.getId()));
}
}
}
}
}
Expand Down

0 comments on commit b6e10dd

Please sign in to comment.