[PJUG Javamail] JSF question making sort on tomahawk t:dataTable case-insensitive
Michael Phoenix
michaelandrewphoenix at gmail.com
Thu Mar 12 17:01:19 EST 2009
Thanks Ken, your advice was spot on. The one thing about the
sortPropertyName attribute is you have to point to a property in the
java class of the objects that make up the collection being displayed
in the data table. It is one of those rare cases where you can't use
EL.
Mike
On Wed, Mar 11, 2009 at 11:22 PM, Ken Paulsen <Ken.Paulsen at sun.com> wrote:
>
> I haven't used the tomahawk components, but I'd be willing to guess that you
> can use the t:column's "sortPropertyName" attribute to point to a "property"
> that returns a lowercase value of the property you want to sort. For
> example:
>
> <t:column ... sortPropertyName="sortContactName" ...
>
> In your java code:
>
> public String getSortContactName() {
> return contactName.toLowerCase();
> }
>
> Good luck!
>
> Ken
>
> Michael Phoenix wrote:
>>
>> We are currently using JSF 1.1 for our UI and we want the table below
>> to be able to sort alphabetically, but case-insensitive. I haven't
>> found much with Google, so I was hoping for some help here. If you
>> know of a good JSF forum where I would have a decent chance of getting
>> help on this or happen any suggestions on how to approach this
>> problem, I'd be really grateful.
>>
>> Mike
>>
>> <t:dataTable id="usersList" var="user"
>> value="#{UsersListPage.users}"
>> styleClass="scrollerTable"
>> headerClass="SortedTableHeader"
>> rowClasses="table_Row1,table_Row2"
>>
>> columnClasses="table_Column,table_Column,table_ColumnCentered"
>> rowIndexVar="rowIndex"
>> preserveDataModel="false"
>> sortColumn="#{UsersListPage.sortColumn}"
>> sortAscending="#{UsersListPage.sortAscending}"
>> preserveSort="true"
>> rows="20"
>> width="490">
>> <t:column sortable="true" sortPropertyName="contactName"
>> defaultSorted="true">
>> <f:facet name="header">
>> <h:outputText
>> value="#{msg.userslist_contnam_outputText_value}" id="contnam"/>
>> </f:facet>
>> <h:commandLink action="#{UsersListPage.editUser}">
>> <t:updateActionListener
>> property="#{UsersListPage.selectedUser}"
>> value="#{user}"/>
>> <h:outputText value="#{user.contactName}"/>
>> </h:commandLink>
>> </t:column>
>> <t:column sortable="true" sortPropertyName="organization">
>> <f:facet name="header">
>> <h:outputText
>> value="#{msg.userslist_orgnam_outputText_value}" id="orgnam"/>
>> </f:facet>
>> <h:outputText value="#{user.organization}"/>
>> </t:column>
>> <t:column>
>> <h:commandButton
>> value="#{msg.userslist_delbtn_commandButton_value}"
>> action="#{UsersListPage.deleteUser}" id="delbtn"
>> onclick="return
>> confirm('#{msg.userslist_delbtn_commandButton_onclick}');" >
>> <t:updateActionListener
>> property="#{UsersListPage.selectedUser}" value="#{user}"/>
>> </h:commandButton>
>> </t:column>
>> </t:dataTable>
>> _______________________________________________
>> Web Site - http://www.pjug.org/
>> Javamail mailing list
>> Javamail at pjug.org
>> http://www.pjug.org/mailman/listinfo/javamail
>>
>
More information about the Javamail
mailing list