I am using .Nowm when i apply a condition with eq then it is working great in datatable.
For Reference:
<ace:dataTable id="tbl" ..... rowIndexVar="row"
rowStyleClass="#{((row+2)/2 eq 1)?'chkred':'chknone'}">
but When i am using mod like this
<ace:dataTable id="tbl" ..... rowIndexVar="row"
rowStyleClass="#{((row+2)/2 mod 0.0)?'chkred':'chknone'}">
it throws an exception
java.lang.IllegalArgumentException: Cannot convert ? of type class java.lang.Double to class java.lang.Boolean
I want to know that Why this code is throwing this exception and how can I use “mod” here?
Its cause the result of
modis a double and not boolean , and you were trying to treat that double result as a booleanfor example
#{10 mod 4}will result in 2 and not true or falseAlso, You can’t use
+in EL Expressiontry something like this