I have tried placing the datatable in the main page without any variables and I am noticing the same behaviour. Is there any way to make Facelets and the Tomahawk Datatable auto sort feature play nice?
Tom -----Original Message----- From: Tom Innes [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 15, 2006 10:06 AM To: 'MyFaces Discussion' Subject: Facelets and Tomahawk Datatable I am using Facelets and Tomahawk V 1.13 and I am trying to make a composition component of a datatable using Facelets. I think there is a problem in the auto sort feature, basically the sort column is not being evaluated correctly. Everything works fine except the sorting. I can click on the Country Code or Name and yet nothing is sorted. The sort Column appears to be picking up the id of the element in the list instead of the sort column to be sorted. For Instance Country Code Name CA Canada US United States When I click on the Country Code I get _id58. Does anybody have any suggestions. Tom Here is my composition component <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:t="http://myfaces.apache.org/tomahawk" > <!-- Parameters --> <!-- theController - the Controller that contains the List --> <!-- theName - What the datatable is called - used to specify the various id's --> <!-- Everything above this line in this file is Ignored --> <ui:composition> <h:panelGroup id="#{theName}PanelGroupId"> <t:dataTable id="#{theName}DataTableId" styleClass="scrollerTable" headerClass="standardTable_Header" footerClass="standardTable_Header" rowClasses="standardTable_Row1,standardTable_Row1" columnClasses="standardTable_Column,standardTable_Column,standardTable_Colum n" var="theRow" value="#{theController.listController.dataModel}" rows="10" sortColumn="#{theController.listController.sortColumn}" sortAscending="#{theController.listController.ascending}" preserveSort="true" > <!-- Allow Additional Parameters to be Inserted--> <ui:insert /> </t:dataTable> <h:panelGrid id="#{theName}PanelGridId" columns="1" styleClass="scrollerTable2" columnClasses="standardTable_Column" > <t:dataScroller id="scroll_1" for="#{theName}DataTableId" fastStep="10" pageCountVar="pageCount" pageIndexVar="pageIndex" styleClass="scroller" paginator="true" paginatorMaxPages="9" paginatorTableClass="paginator" paginatorActiveColumnStyle="font-weight:bold;" > <f:facet name="first" > <t:graphicImage url="/images/arrow-first.gif" border="1" /> </f:facet> <f:facet name="last"> <t:graphicImage url="/images/arrow-last.gif" border="1" /> </f:facet> <f:facet name="previous"> <t:graphicImage url="/images/arrow-previous.gif" border="1" /> </f:facet> <f:facet name="next"> <t:graphicImage url="/images/arrow-next.gif" border="1" /> </f:facet> <f:facet name="fastforward"> <t:graphicImage url="/images/arrow-ff.gif" border="1" /> </f:facet> <f:facet name="fastrewind"> <t:graphicImage url="/images/arrow-fr.gif" border="1" /> </f:facet> </t:dataScroller> <t:dataScroller id="scroll_2" for="#{theName}DataTableId" pageCountVar="pageCount" pageIndexVar="pageIndex" > <h:outputFormat value="Page {0} of {1}" styleClass="standard" > <f:param value="#{pageIndex}" /> <f:param value="#{pageCount}" /> </h:outputFormat> </t:dataScroller> </h:panelGrid> </h:panelGroup> </ui:composition> <!-- Everything above this line in this file is Ignored --> </html> I call the composition component from my main page as follows: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:t="http://myfaces.apache.org/tomahawk" xmlns:as="http://com.alltiers.client.jsf/allTierSystems" > <ui:composition template="/facelets/layout/aQBEFormLayout.xhtml"> <ui:param name="theTitle" value="#{countryQBEController.title}"/> <ui:param name="theFormName" value="countryQBEForm"/> <ui:param name="theController" value="#{countryQBEController}"/> <ui:param name="theNextController" value="#{countryFormController}"/> <ui:define name="content"> <h:panelGrid id="countryQBEFormPanelGrid" columns="3"> <as:afInputText theController="#{countryQBEController}" theFieldName="countryCode" > <as:aString case="upper" trim="none"/> </as:afInputText> <as:afInputText theController="#{countryQBEController}" theFieldName="name" > </as:afInputText> </h:panelGrid> <as:afDataTable theController="#{countryQBEController}" theName="countryList" > <as:afColumn theLabelController="#{countryQBEController}" theFieldName="countryCode" > </as:afColumn> <as:afColumn theLabelController="#{countryQBEController}" theFieldName="name" > </as:afColumn> <as:afColumnGroupCommands theController="#{countryQBEController}" theNextController="#{countryFormController}" > </as:afColumnGroupCommands> </as:afDataTable> </ui:define> </ui:composition> </html>