Few days ago I got a situation where i had to compare a part of a string type vo attribute to decide on rendering a component. The value in the vo attribute was a url like http:://facebook.com/user/id=2454555 . So, the requirement was to render a component only if the url is of facebook. By default you cannot write an EL expression on render property to achieve this. So here is what you can do:
1. On the jspx or jsff add xmlns:fn="http://java.sun.com/jsp/jstl/functions" Make sure to add the library as well in the project properties
2. Now you can right as: <af:outputtext id="o1" rendered="#{fn:contains(row.link, 'facebook') ? true :false}">
1. On the jspx or jsff add xmlns:fn="http://java.sun.com/jsp/jstl/functions" Make sure to add the library as well in the project properties
2. Now you can right as: <af:outputtext id="o1" rendered="#{fn:contains(row.link, 'facebook') ? true :false}">
3 comments:
Hi, were you able to achieve this?
Yes and that is why it is posted here.
works like a charm .
Post a Comment