Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can do it in <a href="http://www.jboss.org/richfaces/" rel="nofollow">Richfaces</a> too. Richfaces 3.3.x supports easy sort:</p> <pre><code>&lt;rich:column sortable="true" sortBy="#{res.retailerCode}"&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="#{msg.retailerId}" /&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{res.retailerCode}" /&gt; &lt;/rich:column&gt; </code></pre> <p>In Richfaces 4.x you can sort datatable using Sorting bean:</p> <pre><code>&lt;rich:column id="cardNumber" sortBy="#{res.instNumber}" sortOrder="#{cardholderSorting.cardNumberOrder}"&gt; &lt;f:facet name="header"&gt; &lt;a4j:commandLink value="#{msg.cardNumber}" action="#{cardholderSorting.sortByCardNumber}" render="cardholderTable" /&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{res.cardNumber}" /&gt; &lt;/rich:column&gt; </code></pre> <p>or your DataModel (extends ExtendedDataModel):</p> <pre><code>&lt;rich:column id="retailerCode" sortBy="#{rs.retailerCode}" sortOrder="ascending"&gt; &lt;f:facet name="header"&gt; &lt;h:commandLink value="#{msg.retailerId}" style="text-decoration: none; color:black;"&gt; &lt;rich:componentControl target="retailerTable" operation="sort"&gt; &lt;f:param name="column" value="retailerCode" /&gt; &lt;f:param value="" /&gt; &lt;f:param name="reset" value="true" /&gt; &lt;/rich:componentControl&gt; &lt;/h:commandLink&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{rs.retailerCode}" /&gt; &lt;/rich:column&gt; </code></pre> <p>You can add arrows (for sorting order displaying) inside in command link and it will be exact same presentation as in Richfaces 3.3.3.</p> <p><strong>UPDATE</strong></p> <p>Starting from RichFaces 4.5 there is support of simple sorting in dataTable (like it was in version 3.3.x).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload