*
The moose likes Struts and the fly likes Struts2: dependent drop down problem 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 » Frameworks » Struts
Bookmark "Struts2: dependent drop down problem" Watch "Struts2: dependent drop down problem" New topic
Author

Struts2: dependent drop down problem

selvaraju sellamuthu
Ranch Hand

Joined: Jun 28, 2007
Posts: 53
in our project we are using ejb3.0 and struts2.0.I need guide links to implement dependent drop down lists.can directly cal bean in javascript using Ajax,Struts 2 allows s:select tag to get list.if we use two lists,one list should be empty,means no values.i tried to give id and name property without list property.But it doesnt allow without list property in select tag.how can i implement using Ajax with Struts2,In google,i didnt get sample code for struts2.x with Ajax examples.
this is urgent.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'm not sure if this will help in your situation or not, but there is an example of a dependent autocompleter in the struts-showcasee-2.0.x.war file that comes with the download.

One word of caution, though: while this example worked fine for me using the FireFox browser, it did not work using Internet Explorer Version 7.
[ December 18, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
selvaraju sellamuthu
Ranch Hand

Joined: Jun 28, 2007
Posts: 53
Originally posted by Merrill Higginson:

One word of caution, though: while this example worked fine for me using the FireFox browser, it did not work using Internet Explorer Version 7.

then any other way to do that.i tried that from struts2 showcase examples,but i didnt get in ie, is it neccessary to make dwr.xml file inside WEB-INF.Can you give me brief to implement dependent drop down.
Thanks in advance
selvaraju sellamuthu
Ranch Hand

Joined: Jun 28, 2007
Posts: 53
autocompleter
i tested the above link,which you have given me struts2-showcase,for both IE7 and Firebox 3 beta,sample is not working.Please find me other solution,Thanks
selvaraju sellamuthu
Ranch Hand

Joined: Jun 28, 2007
Posts: 53
work is Done by combining Ajax DWR with Struts2 autoCompleter tag.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Selvaraju,

Thanks for letting us know how you solved it. If you get the time, it would be great if you could show us some sample code of your solution. These forums are searchable, and I'm sure it would help the next person having this problem to see your solution in greater detail.

Merrill
[ January 02, 2008: Message edited by: Merrill Higginson ]
selvaraju sellamuthu
Ranch Hand

Joined: Jun 28, 2007
Posts: 53
JSP Code

AjaxHelper.class


dwr.xml

i got the billingCountry list values from Action class when form loads.
In AjaxHelper,i have written code for get Ejb Bean which will return City values as list.
This code will work in all versions of IE ,firebox.
Thanks.
Sachin Joshi
Ranch Hand

Joined: Aug 06, 2008
Posts: 83

For the benefit of other developers who are still looking for a similar problem here is a well organized and good example of Struts 2 AJAX drop down

Fixed link (Merrill)
[ September 01, 2008: Message edited by: Merrill Higginson ]

Web Development Tips and Tutorials - By Sachin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2: dependent drop down problem
 
Similar Threads
populate items using struts2 <s:select>
Struts2
problem with struts2 checkbox
Struts2 Pagination
ajax dojo problem with struts2