Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-01-20
2
Medium Priority
?
426 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 1500 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

722 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