Simple question which I can't find an answer to by searching the forums.
How do I use
JSF EL Binding to get the length of an Array in a backing bean?
Example:
If the size of an Array is 0, I want to set the render attribute of a <h:dataTable> to false.
With a managed backing bean like this:
@ManagedBean
public class acctBean
{
public Account[] accts;
public Account[] getAccts() {
return accts;
}
..
}
I'd like to render/not render the datatable like this:
<h:dataTable class="acctTable" border="1" value="#{acctBean.accts}" var="item" rendered="#{acctBean.accts.length > 0}">
However, this throws an exception:
SEVERE: java.lang.NumberFormatException: For input
string: "length"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
Suggestions? Google isn't giving me a search result for an answer yet....
Thanks.