dev@jsftemplating.java.net

Re: JSFTemplating: Table Sorting problem

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Sat, 20 Jan 2007 13:03:08 -0800

Hi Karam,

I am not an expert on all the features of the Woodstock components. You
might be best checking with the Woodstock component team for the best
answer to this question.

That said... it appears that a <sun:tableColumn> has a "sort" property.
That sort property appears to need to be bound to the data that should
be used to sort that column. This is typically the same value that is
displayed to the user in that column. In the table.jsf example I sent
you, it did sorting on the checkbox column and bound itself to the
checkbox selected value. For the default sort behavior, I think this is
all you need to do. It might be possible to do more advanced sorting...
but I am not familiar with how this works. There does seem to be quite
a bit of table documentation, though, so perhaps the answer is there.

I hope this helps!

Ken Paulsen
ken.paulsen_at_sun.com
https://jsftemplating.dev.java.net

Karam Singh Badesha wrote:
> Hi,
> Table data variable is set as a pageSession in my code. When I click
> on any column header to do the sort, all my content disappears and I
> get an empty table. Please let me know what am I doing wrong. My first
> column is of type String and other two are integers.
> Can someone please explain the "sort" option of the table with some
> examples(example where content is of mixed types). Not knowing the
> proper use, I just used the following for my columns looking at the
> examples provided by woodstock.
> sort="first"
> sort="second"
> sort="last"
>
> Now if I change that to say (not sure what this is doing):
> sort="#{1}"
> sort="#{2}"
> sort="#{3}"
> Now the data doesn't disappear when I click for sort and I am able to
> do multiple sort by clicking of + but the data is not sorted. So I am
> pretty sure the problem is with the sort definition in my code. Please
> help.
>
> thanks
> Karam