Mike – are you calling the sort method from within your getUpdates getter method in your bean (I’m assuming Updates is your arraylist/datamodel since you have value ="#{TD.updates}" ?

 

Note I’m not sure if this is needed or not – you are ahead of where I am with regards to getting this working  – I’m still working on understanding how to implement this;  The reason I’m asking about including the sort in the getter method is because of a response I received from another mail list (mistakedly sent this to the dev mail list earlier):

 

“-----Original Message-----
From: Thomas Spiegl [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 29, 2005 6:02 AM
To: MyFaces Development
Subject: Re: Tomahawk DataTable Sort Question - where/how is Sort Coded?

 

Sort your data in getArrlist_providers depending on the values of

sortcol and sortascending.

Collections.sort(arrlist_providers, YourComparator) may sort the list.

 

Also, here is another example I just found that shows calling the sort within the getter method: 

http://mail-archives.apache.org/mod_mbox/myfaces-commits/200505.mbox/[EMAIL PROTECTED]

 

One good working example end-to-end (complete code) would be very helpful.  The link above is the closet I have found, however, I’m still deciphering it – for example, sort(getsortt(), getascending()) – I’m not sure what the getsort() actually calls or resolves to?

 

 

Thanks

Tom

                    

 

 


From: Mike [mailto:[EMAIL PROTECTED]
Sent: Friday, December 30, 2005 4:23 PM
To: MyFaces Discussion
Subject: Data Table Sorting still not working

 

Hi Geeta ,

(Sorry I got your name wrong before....)

Below was a typo. Sorry. It should have been Persons, not getPersons.

I tried to replace TD with a longer name but that didn't help.

I'm baffled. The "hard" stuff, the programming, is so easy compared to just "hooking up" the Data Table component. I've now spent another day on this and have gotten nowhere.

For some reason, the commandSortHeader is just not working. I've also tried to download a fresh "myfaces-all.jar" in case that was it. And, I've tried to disable my firewall software. No dice. When I compare the sample to what I have, they seem identically set up. Of course, I can't yet verify the sample would run here either.

I suppose what I'll need to do is get the example installed an working. I'm afraid that will be as difficult as what I'm facing now with all the config file tweaks and such.

Thanks very much for your help!!!

    Mike




[EMAIL PROTECTED] wrote:


Mike <[EMAIL PROTECTED]> wrote on 12/30/2005 12:36:39 PM:

> Hi Gretta!
>
> Thanks for your reply.
> Please see my comments in-line below....


>
> Mine is:  value ="#{TD.getPersons}"  
>

Shouldn't you simply have "#{TD.persons}" ? Here's what i have:
<t:dataTable id="contactsearchdata" styleClass="scrollerTable"
        headerClass="standardTable_BgWhiteHeader"
        footerClass="standardTable_Header"
        rowClasses="standardTable_Row1,standardTable_Row2"
        columnClasses="standardTable_ColumnCentered,standardTable_Column,standardTable_Column,standardTable_ColumnCentered,standardTable_ColumnCentered,standardTable_ColumnCentered"
        var="contact"
      value="#{search.matchingContacts}"
        rows="7"
        rowId="#{contact.id}"
        sortColumn="#{search.sort}"
        sortAscending="#{search.ascending}"
        preserveSort="true">


Also, if all else fails, try replacing your name "TD" with something else. I remember (though this was a long time ago!) short names which were capitalised created trouble with reflection..

>
>
> Strange, huh?
>
>     Mike


Regards,
Geeta (..umm.. not "Gretta" ;))

 

Reply via email to