Bonjour, je suis confronté à un problème dont je suis sur vous avez la solution

J'utilise une première combo sur laquel un évènement onChange() est associé. Quand on choisi un élément, cela appelle une fonction ajax grace au framework DWR. En retour cela me retourne un tableau dont j'aimerais me servir pour remplir une deuxième combo. Mais voila, je ne sais pas comment faire, avec struts et la balise html:select, pour que cette collection soit utilisée pour remplir une deuxième combo... j'ai fais pas mal de recherche sur le net mais je ne trouve rien qui m'apporte une solution...

voila mon code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
 
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="/WEB-INF/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/WEB-INF/tags/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tags/struts-bean" prefix="bean"%>
<html>
<head>
 
<script src='http://localhost:8080/ThinClient/dwr/interface/Tranche.js'></script>
 
<script src='http://localhost:8080/ThinClient/dwr/engine.js'></script>
<script src='http://localhost:8080/ThinClient/dwr/util.js'></script>
 
<script type="text/javascript">
function updateTranches() {
  var site = dwr.util.getValue("site");
  Tranche.tranches(site, function(data) {
    dwr.util.setValue("resultat", data);
  });
 
}
</script>
 
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
 
<html:form action="choix.do">
	<html:select property="site" onchange="updateTranches()">
		<html:options collection="sites" property="id" labelName="Site Id" />
	</html:select>
 
	<!-- Construire dynamiquement la liste des tranches grace à la collection retournée... -->
<html:select property="tranche">
	<html:options name="resultat" collection="????ici je dois mettre la collection retourné par DWR mais comment faire ????" property="id"
			labelName="Tranche Id" />
	</html:select>
 
	<html:submit value="Send"></html:submit>
</html:form>
 
</body>
</html>
Donc en fait, mon problème c'est que la fonction dwr.util.setValue("resultat", data); cherche une propriéré value dans le tag html:select...

je suis coincé je sais plus comment faire ...

j'avais pensé utilisé un champ caché (ce que j'ai testé) pour récupérer la collection, mais après le problème reste le meme, comment itérer dynamiquement sur cette collection pour créer une combo ?

please help me

merci à tous