• 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
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

how to pass a list from javaside into javascript?

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all, i have points list in my managed bean and i should pass these into the javascript how can i do this?

Best Regards.
 
Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You can use a4j within RichFaces to return a JSON structure through an assync method calling.
Regarding a4j you can use the a4:jsFunction like follows:



action: the method to call assync
data: a getter method defined at myBean (which returns the List parsed with JSONObject or JSONArray)
name: the name of the javascript function to call on your jsp
oncomplete: the javascript function that will receive the JSON data to be processed as you wish

I hope you can use Richfaces on your project, or newer JSF versions.

Another way to use AJAX: take a look at DWR

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic