Hello everyone!
I've problem related with data binding for webuijsf:table, I've array in sessionBean of my custom class objects, but but..., the thing is that I can just bind columns to value like:
currentRow.value['name']
but what if i've array inside of each custom objects and i want to split data from array to different columns,
for example:
Object Person[] (SessionBean) ==> bind to table
in class Person:
{
String notesStr[] = {"note 1","note 2","note 3"};
}
so how i suppose to get value from table using currentRow.value[] syntax? like: currentRow.value[noteStr[0]] ?? (it's not working at all...)
in backing bean I created sample code to support dynamic table, but works with single variables not with String array..:
FacesContext fc = FacesContext.getCurrentInstance();
ValueExpression ve = fc.getApplication().getExpressionFactory().createValueExpression(fc.getELContext(), "#{currentRow.value['testStr']}", String.class);
if (!columnInView) {
TableColumn col1 = new TableColumn();
col1.setVisible(true);
col1.setRendered(true);
col1.setHeaderText("DynCol1");
col1.setId("dynCol1");
// col1.setSort("desc");
StaticText st = new StaticText();
st.setValueExpression("value", ve);
col1.getChildren().add(st);
tprogress.getTableRowGroupChild().getChildren().add(col1);
}
cheers
Walter