• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

pass bean property values to javascript function

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic