I need to put a date into the title attribute of an image so that it displays when the user puts the mouse over. Problem is I would like to change the date format.
Any ideas?
<ice:graphicImage value="bean.image" title="#{bean.date}"/>
I need to put a date into the title attribute of an image so that it displays when the user puts the mouse over. Problem is I would like to change the date format.
Any ideas?
<ice:graphicImage value="bean.image" title="#{bean.date}"/>
Either do it directly in a getter method
public String getDate() {
return new SimpleDateFormat("yyyy-MM-dd").format(this.date);
}
or grab JSTL's <fmt:formatDate>
.
<fmt:formatDate value="#{bean.date}" pattern="yyyy-MM-dd" var="date" />
<ice:graphicImage value="bean.image" title="#{date}"/>
(which would not work inside repeating components like UIData
)