thanks for your reply. i already solved the problem. 

I missed something that it is said in this site: 
http://getahead.ltd.uk/dwr/getstarted

"The new creator that we used above uses the public no-args constructor that 
all JavaBeans must have"

the class ListaLocalidadSqlMapDao had this constructor:

public ListaLocalidadSqlMapDao(DaoManager daoManager){
                super(daoManager);
}

so i created a new class "[b]Utilities.java[/b]":
public Utilities(){}
        
public List getListaLocalidadByIdMunicipio(Integer idMunicipio) throws 
Exception{
...
} which returns a List of "Localidad" objects.

Then, on [b]dwr.xml[/b] :

<dwr>
  <allow>
        <convert converter="bean" match="es.di.domain.Localidad"/>      
        <create creator="new" javascript="Utilidades">
            <param name="class" value="es.di.comun.Utilidades"/>
        </create>
  </allow>
</dwr>

And in the [b]JSP file:[/b]

<script type='text/javascript' 
src='/pcmtmp/dwr/interface/Utilidades.js'></script>

  function cambiaLocalidad() {  
DWRUtil.removeAllOptions("localidades");
 
Utilidades.getListaLocalidadByIdMunicipio($("municipios").value,onCambiaLocalidad);
}
        
function onCambiaLocalidad(data) {
        DWRUtil.addOptions("localidades",data,"id","nombre");
}

And as it is explained at this site: http://getahead.ltd.uk/dwr/browser/lists
i used the option: Array of objects (with differing option text and value):  
DWRUtil.addOptions(selectid, data, prop) since [b]Localidad.java[/b] is:

public class Localidad {
        
private String id;
private String nombre;
...
}
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=33630&messageID=65477#65477


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to