Regarding
https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1414: we use
direct manipulation of component for following:
1) User selects a subset of all available column ids and orders them
with a component like selectOrderShuttle
2) a listener reorders UIColumn(s) in UIData with algorithm pasted
below.
Can you please check that if is it a correct solution? Issue is that
facelets VDL rebuilds entire UIData from xhtml and drops that change.
Btw. which mailing list is suitable for discussing advanced JSF topics?
For example questions like "listeners and partial state saving" or
"developing DSL based on facelets engine"- is it
webtier_at_glassfish.dev.java.net ?
Thanks,
Martin Kočí
Code:
List<UIComponent> columns = table.getChildren();
for (int i = 0; i < columnIds.length; i++) {
final String columnId = columnIds[i];
final int pos = findColumnIndex(columns, columnId);
final UIComponent column = columns.remove(pos);
column.setRendered(true);
columns.add(i, column);
}
for (int j = columnIds.length; j < columns.size(); j++) {
final UIComponent component = columns.get(j);
component.setRendered(false);
}