This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes how to pass a list from javaside into javascript? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "how to pass a list from javaside into javascript?" Watch "how to pass a list from javaside into javascript?" New topic
Author

how to pass a list from javaside into javascript?

ihsan kocak
Ranch Hand

Joined: Mar 14, 2012
Posts: 31
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.
Adolfo Eloy
Ranch Hand

Joined: Mar 21, 2009
Posts: 146


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


Adolfo Eloy
Software Developer
OCPJP 6
 
 
subject: how to pass a list from javaside into javascript?
 
Similar Threads
Equal Symbol Expected?
passing a variable from html/jsp to javascript
global variables in Javascript
parameter from jsp to javascript function?
Servlet Called From Javascript