This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to call javabean from jsp page upon onChange event  RSS feed

 
Ajay Soni
Greenhorn
Posts: 8
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know how to call javabean from jsp page upon onChange event. Can anyone send me some sample code. Other problem which I have is that i want to show two selection boxes in my page, one master list and the other slave which depends on the selected value of first list. I dont know how to do that. Please help me with some example code. Thanks in Advance.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use javascript function on your onChange event. That function can make request to a web resource. Or you can better off use RPC. In that case exploring AJAX would be your best bet.

AJAX tutorials would also solve your parent/child boxoes issue. Otherwise you can load all the values to some javascript array and then play with javascript and onclick event.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To re-iterate what Adeel said:
The onChange event occurs on the client, long after the (server side) JSP is finished processing and is no longer in play.

To do anything on the server with Java from an onXxx event trigger in Javascript will require a completely new request to the server.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this article.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!