I have a scenario where I have a list of objects that extend a common supertype. This list of objects is supplied to the h:datatable as it's value.
The last column in the table has inputs that are subtype-specific whereas all the other columns apply to fields found in the common superclass.
What is the most elegant way of rendering the subtype-specific fields ?
At the moment I am doing this:
<h:column>
<c:if test="#{cover.cd eq 2}">
//Markup specific to this subtype
</c:if>
<c:if test="#{cover.cd eq 3}">
//Markup specific to this subtype
</c:if>
</h:column>