I was wondering if there was a possibility to use the datatable and to sort on a different value then the one displayed.
We have at the moment an image displayed in a column and we would like to sort on the corresponding numeric value.
But this doesn't seem to be working.
Any idea if what I'm trying to achieve is possible.
If not I'll just remove the sort on that column.
Regards,
Without Sort
Code: Select all
<p:column id="column_co2emission" resizable="false" width="17" style="white-space:normal" headerstyleClass="rightcol" styleClass="rightcol">
<f:facet name="header"><h:outputText styleClass="headerText" value="#{msg.contractlist_co2emission}" /></f:facet>
<h:graphicImage id="vehicle_energylabel" value="#{path.staticRootUrl}images/energylabel_#{contract.catalogvehicle_energylabel}.JPG" />
</p:column>
Code: Select all
<p:column id="column_co2emission" resizable="false" width="17" sortBy="#{contract.catalogvehicle_co2emission}" style="white-space:normal" headerstyleClass="rightcol" styleClass="rightcol">
<f:facet name="header"><h:outputText styleClass="headerText" value="#{msg.contractlist_co2emission}" /></f:facet>
<h:graphicImage id="vehicle_energylabel" value="#{path.staticRootUrl}images/energylabel_#{contract.catalogvehicle_energylabel}.JPG" />
</p:column>
I presume this is linked by the fact that the content is an image and not the corresponding value.