This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Extracting values from JSTL forEach  RSS feed

 
Amit Malhotra
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a situation in which I need to populate a javascript array with certain values. This array will then be the input to an Ajax (Dojo) table model. I'm having trouble figuring out how I can populate this array. What I would want is:

var a = new Array();

<core:forEach items="${companies}" var="company">
//populate my array with company.id, company.symbol, and company.name
</core:forEach>

I've tried several options to obtain company.symbol etc and put them into my array (or any javascript variable), but nothing seems to work.

Any suggestions?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but nothing seems to work.


This is not a useful description of the error.

Do the elements in the array have the appropriate property accessors defined?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!