Hi Johnson (and others), I'm not really as retarded as I sound in the previous mail, just distracted while I was composing the mail. Please contact me if you find it as difficult to follow as I did after reading the first reply...
Jo -----Original Message----- From: Johan Snyman [mailto:[EMAIL PROTECTED] Sent: 30 January 2008 03:43 PM To: 'Struts Users Mailing List' Subject: RE: Struts 2 onchange event to get values from databases Hi Johnson, I'm no Struts expert but from my experience you have two ways of implementing what you want to achieve. 1. You can populate your dropdown box and have the fields empty. On your element you can set the onchange to call a javascript function that calls the same action, but passing it the content of your combobox, to do your database lookup on the server side and then pass the info to your userdetails.jsp where you can set your fields. 2. You can use AJAX to do the call asynchrononously, that is the value is passed to an action on the server and without the values passed back and filled into your fields. Nowadays you'll find plenty of tutorials and examples out there. Check out the following: http://struts.apache.org/2.x/docs/ajax.html (the official Struts AJAX guide) http://www.roseindia.net/struts/struts2/struts2ajax/index.shtml (easy login example) http://www.javaworld.com/javaworld/jw-08-2007/jw-08-ajaxtables.html?fsrc=rss -index (although is a rather tough example to follow if you're new to AJAX) http://www.planetstruts.org/struts2-showcase/showcase.action (showcase examples) Hope this helps Jo -----Original Message----- From: Johnson nickel [mailto:[EMAIL PROTECTED] Sent: 30 January 2008 03:26 PM To: user@struts.apache.org Subject: Struts 2 onchange event to get values from databases Hi All, I am using Struts 2 application, i have userdetails.jsp its contains five text fields. two buttons save and update. In my action i have written save() method and update() method. In my jsp one drop down box its contains users. At the time of onchange event to populate the text fileds values from databases. can u give me any solutions how to do this? -- View this message in context: http://www.nabble.com/Struts-2-onchange-event-to-get-values-from-databases-t p15182158p15182158.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.16/1250 - Release Date: 2008/01/29 10:20 PM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.16/1250 - Release Date: 2008/01/29 10:20 PM --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.16/1250 - Release Date: 2008/01/29 10:20 PM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.16/1250 - Release Date: 2008/01/29 10:20 PM --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]