Hi,
I'm trying to create a tr:table using binging, and almost everything
works fine except, getting row values in table.
I've created in index.xhtml this:
<tr:table binding="bean.table" />
and in backing bean crating columns, and outputText inside columns. This
is working well, but I can't figure out how to set value to the
outputText as an expression using row value. Example:
table.setValue(getMyData());
table.setVar("row");
CoreColumn column = new CoreColumn();
column.setParetn(table);
column.setTransient(true);
CoreOutputText text = new CoreOutputText();
text.setParent(column);
text.setTransient(true);
column.getChildren().add(text);
table.getChildren().add(column);
and now the tricky part. How to set an value to text?
1. case
text.setValue("bla"); --- it works, "bla" is showing in each row of the
table.
2. case and 3. case
ExpressionFactory ef =
FacesContext.getCurrentInstance().getApplication().getExpressionFactory();
ELContext elContext = FacesContext.getCurrentInstance().getELContext();
ValueExpression value =
ef.createValueExpression(elContext,"#{'xxx'}",String.class);
text.setValue(value) --- "ValueExpression[#{'xxx'}] is showing as output
in table cell
text.setValueExpression("value",value) --- table cell is empty
Is there any possibility to assign an EL expression in managed bean, to
be executed during table.encode phase or that value is treated as
ValueExpression, and not as String.
Thank you,
Luka