• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pass bean property values to javascript function

 
Chetan Ram
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a bean class Person which has properties like name, age




I want to pass bean property values to javascript function for further use.

I can use struts <logic:iterate> or <c:foreach> to iterate over the bean properties.

Thanks for any help.

Chinnu
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I Assume that you do iteration then display/non-display the value into a td(table). then just get the text/string value in javascript!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Niether of the Struts proprietary tag or <c:forEach> will "iterate" over properties. They are intended to iterate over collections.

What is it you are really trying to accomplish so we can guide you to the more appropriate methods?
 
Chetan Ram
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

we store bean objects in an arraylist. So in JSP, we get arraylist which contains beans.
I want to pass bean properties values to javascript.

Expected : I want to pass bean properties values to datagrid to display it in UI.

What I understand is that data needs to be passed to form the datagrid content to display.
I am trying to use dojo datagrid.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic