I am creating a dynamic datatable in JSF 1.1.
HTMLDataTable table = new HTMLDataTabl();
table.setVar("rowObj");
table.setValue(.....);
I'm trying to evaluate the value of var
, but it returns null
.
FacesContext ctx = FacesContext.getCurrentInstance();
ctx.getApplication.getVariableResolver().resolveVariable("#{rowObj}"开发者_开发百科); // null.
How to get value of variable reference of datatable using JSF 1.1?
You can't get the evaluated value of the var
attribute. It's not available in the component tree. It's only available in the rendered output, while the datatable is iterating over its value
.
If you elaborate what exactly you need it for, then we may be able to suggest the right approaches. Probably you just need the value
instead of var
or maybe you don't need it at all.
精彩评论