Hi,
Columns are sorted based on their values. If the column contains a non
comparator object it will converted to a String -> object.toString().
In your case you add a PageLink (which does not implement
java.util.Comparator) to the Column. When the data is sorted the
PageLink is converted to a String:
"
West Bank"
It is this String value that is sorted, not "West Bank" as you would want.
A simple solution is create a separate column for the company name
which can be sorted. The second column can contain the PageLink with
its label set to "edit" for example.
kind regards
bob
PS: I notice that you set the PageLink listener. PageLink only links
to Pages and won't invoke a specific listener. In fact PageLink
Javadoc states that calling setListener does nothing.
mravister wrote:
> Hi Everyone, I am begginer to Click framework.Below is the code that I
> use in OnInit() method, where I am getting 'companyNames' from database
> table and adding pageLink in every row to navigate to other page class.I
> have declared pageLink like this: PageLink tmpCompanyNameLink = new
> PageLink(EditReportPage.class); List companiesList = (new
> CompanyDetails()).getAllCompanies(); List> tableData= new ArrayList>();
> if (companiesList != null) { for (Iterator iterator =
> companiesList.iterator(); iterator.hasNext();) { Map tableRowData = new
> HashMap(); Company company = iterator.next(); String tmpComanyName =
> company.getCompanyName(); tmpCompanyNameLink.setName(tmpComanyName);
> tmpCompanyNameLink.setLabel(tmpComanyName);
> tmpCompanyNameLink.setListener(this, "OnCompanyClick");
> tmpCompanyNameLink.setContext(context);
> tmpCompanyNameLink.setTitle("Company Name");
> tmpCompanyNameLink.setStyle("color", "black");
> tmpCompanyNameLink.setParameter("id",company.getId().toString());
> tableRowData.put(COMPANY_HEADER, tmpCompanyNameLink.toString());
> tableData.add(tableRowData); } table.setRowList(tableData); } Problem :
> The Company Column is not getting sorted properly with inbuilt column
> comparator.They are not sorted alphabetically either ascending or
> descending on company column sort click.Please provide me the solution
> for this. Thanks, Rav
> ------------------------------------------------------------------------
> View this message in context: Dyanamic PageLink in Table
> <
http://www.nabble.com/Dyanamic-PageLink-in-Table-tp19161310p19161310.html>
> Sent from the click-user mailing list archive
> <
http://www.nabble.com/click-user-f3305.html> at Nabble.com.
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
>
http://moblin-contest.org/redirect.php?banner_id=100&url=/>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Click-user mailing list
> Click-user@lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/click-user-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
Click-user mailing list
Click-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/click-user