I’m working with LastFM api, let’s say I have a class called Artist which I call in this dataTable:
<h:dataTable var="artist" value="#{personEAO.topArtists}" >
<h:column>Artist : #{artist.name} </h:column>
</h:dataTable>
Artit have a field which refers to his picture :
artist.getImageURL(ImageSize.LARGE)
Which works fine, but how do I call this method in my jsf page using dataTable ?
I searched around for Javadocs, but I couldn’t find them anywhere. The answer depends on what kind of constant
ImageSize.LARGEis.If
ImageSizeis an enum, just do:But if it isn’t and is thus a
public staticconstant, then one of the ways is to wrap it in some helper bean which returns exactly that:I of course assume that your environment supports EL 2.2.