facebook

How to sort the result return from a web service.

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #272136 Reply

    jadeite1000
    Member

    Hi All:

    I am using Weblogic 9.2, Web Services Client, and Struts.
    I have a java client in struts that calls a web services.
    The “ID” field contains a Java integer.
    The “First_Name” is a Java String.
    The “Effective_Date” field is a Java date field.
    The web service returns an arrayList.
    From the arrayList, I displayed the result as the following:

    ID FIRST_NAME EFFECTIVE_DATE
    — ——— ————-
    3 John 9/10/2007
    2 Andrew 1/11/2006
    5 Peter 3/4/2006

    The “ID” header is a link.
    The “First Name” header is a link.
    The “EFFECTIVE_Date” is a link.

    If I clicked on the link “ID”, the first time, it will sort the rows in ascending
    order like the following:

    ID FIRST_NAME EFFECTIVE_DATE
    — ——— ————-
    2 Andrew 1/11/2006
    3 John 9/10/2007
    5 Peter 3/4/2006

    If I clicked on the link “ID”, the second time, it will sort the rows in descending
    order like the following:
    ID FIRST_NAME EFFECTIVE_DATE
    — ——— ————-
    5 Peter 3/4/2006
    3 John 9/10/2007
    2 Andrew 1/11/2006

    If I clicked on the “First_Name” field the first time, it will sort the rows in
    desceding order.
    If I clicked on the “First_Name” field the second time, it will sort the rows in
    ascending order.

    This applies the same for the “EFFECTIVE_DATE”.

    Any hint would be greatly appreciate.

    Yours,

    Frustrated.

    #272154 Reply

    Riyad Kalla
    Member

    Moving OT > Soft Dev

    #272167 Reply

    rkm258
    Member

    Hi

    See http://kryogenix.org/code/browser/sorttable/ for sortable tables.

    One suggestion is to execute the database query by using order by at the beginning to get the Array list you need in
    a particular form.

    Also I think you might have user the aegis.xml file for the Service Interface with the component type having the package path to the class whose objects are in the arraylist.

    Thats it. Reply if u need any thing.
    bye
    Ram

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: How to sort the result return from a web service.

You must be logged in to post in the forum log in