Closed Thread
Results 1 to 2 of 2

Thread: List Sorting in JSP

  1. #1
    akuccputsedut is offline Newbie
    Join Date
    Oct 2009
    Posts
    1
    Rep Power
    0

    Question List Sorting in JSP

    I need help to sort this list to be alphabetically
    I have an array list in this list name have different categories and color. I need to sort it by cotegories, color and sort by ascending order

    the out come will be like this Ami is name, cat is categories and color is blue..(color that I mention is color font)
    Ami-cat-blue
    Aki-cat-blue
    Bobo-cat-blue
    Bobby-dog-yellow
    riki-dog-yellow


    Code:
    for( int i=0; i < records.size(); i++) {
    
                   if (((String) (((Attributes) records.elementAt(i)).get("animaltype").get())).equals("cat")) {
                       catList.add(records.elementAt(i));
    
    
                   } else if (((String) (((Attributes) records.elementAt(i)).get("animaltype").get())).equals("dogs")) {
                       dogsList.add(records.elementAt(i));
                   }
    
    records.removeAllElements();
    
                records.addAll(catList);
                records.addAll(dogsList);
    now I can sort it by color and categories but how to make name list in ascending order in jsp
    Need HELP...thank you

    Intelligent is me..
    Sometimes got confius
    Need HELP..!!

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: List Sorting in JSP

    Can you post the rest of your HTML so we can see the data it is working on?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 10-01-2011, 01:45 PM
  2. Join 2 linked list (sorting is not important)
    By nishbur in forum C and C++
    Replies: 6
    Last Post: 03-21-2010, 05:12 AM
  3. List Sorting in JSP
    By akuccputsedut in forum Java Help
    Replies: 0
    Last Post: 10-12-2009, 11:21 PM
  4. list sorting
    By Siten0308 in forum C# Programming
    Replies: 2
    Last Post: 04-01-2009, 02:47 PM
  5. Bubble sorting a list
    By 0eraser in forum C and C++
    Replies: 1
    Last Post: 06-13-2007, 08:47 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts