Problem solved. It seems that jquery-plugin work perfectly, as usual the error was between the keyboard and the chair...
I forgot to load the data list for the second select, so jquery was unable to select the aproppiate value.
So, the solution was to ensure that the second list (proyectos) was loaded when the user edits an element.
I add a flag (cliente) as a hidden element on JSP and preloaded it from the main action, so I can check from the Ajax Action if it is necessary to populate the second list.
Ingreso Action (main action for the view)
public class IngresoAction extends BaseAction implements Preparable {
private String cliente;
public String edit() {
if (id != null) {
ingreso = ingresoManager.get(id);
cliente = Long.toString(ingreso.getCliente().getId());
} else {
ingreso = new Ingreso();
}
return SUCCESS;
}
public String getCliente() {
return cliente;
}
public void setCliente(String cliente) {
this.cliente = cliente;
}
<...>