• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting value in bean through java script  RSS feed

 
prach Gupta
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
How can we set the value of a bean variable through java script on load?
I have tried doing this by setting the value onLoad but it doesnt reflect untill the page is submitted.
Is there any way out?
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By definition, the bean can't be changed until something is submitted. JSF beans are located in the server, not in the client. To cause the server to change any object inside itself, you have to submit a request to the server.

You can submit a "behind the scenes" request, however. That's what AJAX is all about.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!