Solved

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

Posted on 2014-01-20
2
404 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 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

739 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