Solved

How to create multiple accordions using jquery base on records in arrayList

Posted on 2014-01-20
2
387 Views
Last Modified: 2014-01-24
Hi, I have a requirement to dynamically create accordions using jquery, based on how many records are returned in my array List from my backing bean. So, for each record returned, a new accordion needs to be created on my jsp page. I would attach some code but unfortunately don't have an idea how to start. I would like to know, is this even possible? If anyone could point me to some articles or code snippets, or even some general advice, it would be greatly appreciated.

Thanks!
0
Comment
Question by:grnmachine
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
Basically the idea :
var accordeonList = [];
$.each(arrayList, function(index,value) {
      var accordeon = [];
      $.each($("records", value), function(i,v) {
           var newAccordeonItem = "<-- your design -->";           
           accordeon.push(newAccordeonItem);
      });
      accordeonList.push(accordeon);
});

Open in new window

0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now