aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Read XML file-->listDropdown Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Read XML file-->listDropdown" Watch "Read XML file-->listDropdown" New topic
Author

Read XML file-->listDropdown

renu richard
Ranch Hand

Joined: Oct 06, 2008
Posts: 116
Hi,
I have three dropdown boxes in a JSP. The values to be populated in the drop down list are available in the XML file. Once the value is selected in th first drop down list, it has to display the the correspoding values in the second box after reading the mapped values from the XML and so on.
Can anyone tell me how can i achieve this.


Cheers,
Richard
rajanikanth bhagavan kanth
Ranch Hand

Joined: May 20, 2008
Posts: 78
Use XML Parsers to get the lists and show in drop donw list and for loading another drop down lists use Ajax.

Let me know if im not clear

Regards,
Bhagavan R
renu richard
Ranch Hand

Joined: Oct 06, 2008
Posts: 116
Rajani,
I am familiar with JSP's. But i dont know anything about AJAX. Could you please refer me to any URL's where i could see similar kind of sample code or where i can learn aout AJAX. Also is it not possible to achieve this functionality with javascript alone.(not using AJAX)
[ December 09, 2008: Message edited by: renu richard ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61429
    
  67

Originally posted by renu richard:
Rajani,
I am familiar with JSP's. But i dont know anything about AJAX. Could you please refer me to any URL's where i could see similar kind of sample code or where i can learn aout AJAX.

Start with this article to learn how Ajax works. Then adopt a library such as jQuery or Prototype to do your Ajax for you.

Also is it not possible to achieve this functionality with javascript alone.(not using AJAX)
Not unless you preload all possible values on the page in JavaScript variables in advance.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Veera Sundar
Greenhorn

Joined: Jun 08, 2007
Posts: 25
Originally posted by renu richard:
Rajani,
I am familiar with JSP's. But i dont know anything about AJAX. Could you please refer me to any URL's where i could see similar kind of sample code or where i can learn aout AJAX.
[ December 09, 2008: Message edited by: renu richard ]


I hope this one Implementing Ajax in Java web application using JQuery helps.


Thanks,<br />Veera |<a href="http://veerasundar.com/blog" target="_blank" rel="nofollow">Blog</a>
rajanikanth bhagavan kanth
Ranch Hand

Joined: May 20, 2008
Posts: 78
Yes , with out Ajax also you can implement it.The only problem is you need to submit the entair form to the server.Just call another action if any one selects one item from first dropdown list.

If you want any simple ajax example please gothrough the following link
http://www.w3schools.com/ajax/default.asp

But this is for beginers....

Regards,
Rajani
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Read XML file-->listDropdown