File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes present data in collasible and expandible format. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "present data in collasible and expandible format." Watch "present data in collasible and expandible format." New topic
Author

present data in collasible and expandible format.

thomas davis
Ranch Hand

Joined: Feb 01, 2003
Posts: 207


OR

  • To Add the Expand collapse functionality in a .jsp to display and hide the data


    Details:

    Here I'm able to get the data from webservices to jsp. While displaying the data there is a provision to show and hide some of its data

    Example:

    If Suppose there are 3 rows(Student data) coming from database, Say each row as Student for instance. and Each student is associated with some courses(Say course1, course2 and course3).

    Appearance should look like this:

    Table1:

    Details S.No S.Name S.Address
    --------------------------------
    + 10 Alex Texas
    + 20 John Dallas
    + 30 Nick Newyork

    Now if we click on + button associated with first record, it should exapand and show the first record details and - button to be displayed as shown below.

    Table2:

    Details S.No S.Name S.Address
    --------------------------------
    - 10 Alex Texas

    course1 : Java
    cpurse2 : j2ee

    - 20 John Dallas

    course1: .Net
    course2: php

    + 30 Nick Newyork


    And when when we click on - button it should hide the data and should display the above data as Table1.


    Here I got all the data dynamically. The only problem is UI arrangement(Displaying it).
  • Jeanne Boyarsky
    internet detective
    Marshal

    Joined: May 26, 2003
    Posts: 30294
        
    150

    Can you use jQuery? Take a look at the "my profile" page here for an example.


    [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
    Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
    thomas davis
    Ranch Hand

    Joined: Feb 01, 2003
    Posts: 207
    Jeanne Boyarsky wrote:Can you use jQuery? Take a look at the "my profile" page here for an example.


    how do I do that ? Do you have any example? I need to get data ,when user clicks on the link and expand it with data. And more importantly,the screen should not reloaded. Thanks, I appreciate your insights.. cana you please tell me how do I go to your profile?
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 60992
        
      65

    Please reserve bold for emphasis -- not for your entire post. I have removed it.

    The jQuery UI Accordion widget is described and demoed here.

    "My Profile" is a link near the top of the page.


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 60992
        
      65

    P.S. If an accordion is not what you are looking for because the data is hierarchical (like a file system), you can alos find many jQuery tree plugins.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: present data in collasible and expandible format.