Bonjour,
J'ai deux listes dépendantes, projet et fiche evaluation, je veux choisir un projet dans la première liste et avoir les fiches d'évaluation correspondantes à ce projet dans la deuxième liste.
voila mon action (dans evaluationAction.java)
et voila le code de ma page jsp:
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 EvaluationManager mgr = (EvaluationManager) getBean("evaluationManager"); List evaluations = mgr.getEvaluations(null); request.setAttribute(Constants.EVALUATION_LIST, evaluations); FicheEvaluationManager ficheEvaluationManager=(FicheEvaluationManager)getBean("ficheEvaluationManager"); FicheEvaluation ficheEvaluation = new FicheEvaluation(); List fiches= ficheEvaluationManager.getFiches(null); fiches.add(ficheEvaluation); EvaluationForm evaluationForm = (EvaluationForm)form; evaluationForm.setFiches(fiches); request.getSession().setAttribute("fiches", fiches); ProjetManager projetManager=(ProjetManager)getBean("projetManager"); Projet projet = new Projet(); List projets= projetManager.getProjets(null); projets.add(projet); evaluationForm.setProjets(projets); request.getSession().setAttribute("projets", projets);
le problème est que quand je selectionne un projet dans la première liste les valeurs par défault présents dans les différents champs s'insère dans la base, c'est comme si le "onchange" joue le rôle de valider. Je ne sais pas si la valeur passée en argument à onchange est fausse.
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 <FORM id=evaluation onsubmit="return validateEvaluationForm(this)" action="/cmmi/saveEvaluation.html" method="post" name="myform" > <html:hidden property="id"/> ...... <html:select property="projetId" onchange="document.myform.submit()"> <html:options collection="projets" property="id" labelProperty="nomProjet" /> </html:select> </td> </tr> <tr> <td height="8">fiche dévaluation </td> <td height="13" colspan="2"> <html:select property="ficheId"> <html:options collection="fiches" property="id" labelProperty="nomFiche" /> </html:select> ........ </FORM>
merci d'avance pour votre aide.
Partager