Solved

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

Posted on 2014-01-20
2
389 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
ID: 39795871
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
ID: 39796597
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

914 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

17 Experts available now in Live!

Get 1:1 Help Now