I have a date column in a table (panel group layout). Now I want to display Dates in red colour which are 15 days less than current date and Dates in green colour which are 15 days greater than current date. Kindly share the groovy expression to be used for this.
One way to do so is to have a java public function returning the currentDate minus 15 days in your binded Java Bean and then, to answer your question : "Kindly share the groovy expression to be used for this"
<af:column inlineStyle="color:#{row.YourDate lt YourScope.YourBean.YourJavaPublicFunctionReturningCurrentDateMinus15?'green':'red'}!important" headerText="YourColumnHeader" id="c1">
<af:outputText value="#{row.YourDate}" id="ot22">
<af:convertDateTime pattern="#{bindings.YourIterator.hints.YourDate.format}"/>
</af:outputText>
</af:column>
Note : To apply to all row the El need to be in the colum inlineStyle property and set as !important to bypass any other css classes.