Ajax for populating drop downs list box

Pavan <[email protected]> Wed, 06 Dec 2006 15:06:57 CST
Newsgroups gmane.comp.java.open-symphony.webwork
Message-ID <27376274.1165439649528.JavaMail.os-j2ee@opensymphony01.managed.contegix.com>
Hi,
My webpage will have multiple dropdowns. For example we have drop down selects for country,state and city. When you select a country from first dropdown it makes a dynamic request to the server with the country value selected from first dropdown  and populates the second dropdown with state list returned from Server. In the same way when you select a state value from second dropdown it populates city dropdown list box. 

public class SampleAJAXAction extends Action Support{
private string country;
private String state;
private String city;
private List states;
private List cities;

getters and Setters for those attributes.

public String execute()
{
return SUCCESS;
}
public String listStates()
{
states=getAllStates(country);
return SUCCESS;
}
public String listCities()
{
cities=getAllCities();
return SUCCESS;
}
}

I know that with ajax we can write a java script to listen to the Country drop down change and invoke a asynchronous request. 
1) I tried java script example given for ajax div template. 

<ww:select name="country" cssStyle="position:absolute;left:160px;top:130px;width:278px;" list="{'USA','CAN'}"  onchange="javascript:dojo.event.topic.publish("updateStatesListTopic", this.value);" />

It gives error ww:select not closed.  

Java script is there to get the Topic. ww:head has theme="ajax"
Is it possible to publish a event from WW:Select tag .

2) Do we have Ajax Select template just like ajax div template to populate State list when you change the country.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=52327&messageID=105608#105608

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]