tags:

views:

335

answers:

3

Requirement: To Add the Expand collapse functionality in a .jsp to display and hide the data using JSF component.

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.

Code I've used in Jsp page:

Here I got all the data dynamically. The only problem is UI arrangement(Displaying it). I've put the S.No, S.Name and S.Address fields in one and course details in another . Both columnGroup are embedded in

Here I am facing a problem while displaying courses for each student(Means expand/collapse or show/hide). Facing problem to include a div or a subTable or something else in dataTable.

Request you to help me in this regard and let me know in case any details required from my end.

Sincerely, Vamshi

+1  A: 

Use a <rich:subTable> which you toggle to show/hide with a shot of Javascript and CSS.

BalusC
A: 

Hello Balu, can you please email me your contact information to [email protected]. I would like to discuss on this issue.

Thank you!

Danniel
This should have been a comment rather than an answer. And sorry, I only share my email with real friends. Feel free to start a topic (press `Ask Question` button at right top) here.
BalusC
A: 

Thank you Balu, I don’t have enough time to learn and do expand/collapse in Sub-table. My boss is putting pressure every minute I am really confused. I truly appreciate your help!

Danniel
Once again, this should have been a comment. This isn't a contact advertising forum. Post your own question by pressing `Ask Question` button. If you ask the question the smart way (http://catb.org/esr/faqs/smart-questions.html), you'll likely get good response. Do not waste your time doing nothing, pulling the hair or abusing the forums.
BalusC