Pertes des données après clic une page jsp

Fermé
Bihakia89 - 14 mai 2012 à 20:24
linkcr15 Messages postés 362 Date d'inscription mercredi 7 janvier 2009 Statut Membre Dernière intervention 31 mars 2016 - 15 mai 2012 à 16:23
Bonjours tout le monde,

Mon souci est le suivant:

J'ai une page jsp qui contient 3 listes <html:select>, l'une dépends de l'autre. La première permet de remplir la 2 ème et ainsi de suite, jusqu'à l'obtention d'un tableau contenant les données voulues.
Mais pour avoir ce dernier je dois cliquer sur un bouton <html:submit>.

Le problème est lorsque je clique sur ce bouton je perds toutes les données des listes.

Voici le code de ma page jsp en utilisant Struts 1.3, Hibernate 3, Tag-lib AJAX:

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://ajaxtags.sourceforge.net/tags/ajaxtags"
	prefix="ajax"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>




<!--- body  --->
<div align="center">
<p align="left"><html:link action="/module0">+ Nouveau Module</html:link></p>
	<table>
		<html:form action="/moduleSelect">

			<table align="center" width="40%">
				<!--<tr>
			
			<td width="200"><span class="titre">La direction de :
				<bean:write name="user" property="direction.libelleDr"/></span></td>
				</tr>
				-->
				<tr>
					<td>
						<font size="2"> Direction </font>
					</td>
					<td>
						<html:select property="codeDr" styleId="codeDr"
							styleClass="select0" errorStyleClass="erreur2">
							<html:option value="0-0">- - - Toutes les directions - - -</html:option>
							<html:optionsCollection property="directions" label="libelleDr"
								value="codeDr" />
						</html:select>
					</td>



					<td>
						<font size="2"> Etablissement </font>
					</td>
					<td></td>
					<td>
						<html:select property="codeEfp" styleId="codeEfp"
							styleClass="select0" errorStyleClass="erreur2">
							<html:option value="0-0">- - - Tous les établissements - - -</html:option>
							<html:optionsCollection property="etablissements"
								label="libelleEfp" value="codeEfp" />
						</html:select>
					</td>
				</tr>
				<tr></tr>
				<tr></tr>
				<tr></tr>
				<tr></tr>

				<tr>
					<td>
						<font size="2"> Filières </font>
					</td>


					<td>
						<html:select property="codeFiliere" styleId="codeFiliere"
							styleClass="select0" errorStyleClass="erreur2">
							<html:option value="0-0">- - - Toutes les filières - - -</html:option>
							<html:optionsCollection property="filieres"
								value="id.filiere.codeFiliere" label="id.filiere.libelleFiliere" />
						</html:select>
					</td>

				</tr>
			
				<tr align="right">
					<td align="right" width="100">
						<html:submit value="Lister les modules"
							onclick="/modulefiliereAjax" />
					</td>
				</tr>
				<tr></tr>
				<tr></tr>

			</table>
			</br>


		</html:form>


	</table>

	<logic:present name="modules">


		<table align="center" cellpadding="0" cellspacing="1"
			class="dataTable" width="52%">
			<tr class="header">

				<td>
					<bean:message key="CODE_MODULE" />
				</td>
				<td>
					<bean:message key="LIBELLE_MODULE" />
				</td>
				<td width="5%">
				</td>
				<td width="5%">
				</td>
			</tr>
			<%
				int i = 0;
			%>
			<logic:iterate id="module" name="modules">

				<%
					i++;
							if (i % 2 == 0) {
				%>
				<tr bgcolor="#F3F3F3" onmouseover="this.bgColor ='#999999';"
					onmouseout="this.bgColor='#F3F3F3';">
					<%
						} else {
					%>
				
				<tr bgcolor="#FFFFFF" onmouseover="this.bgColor ='#999999';"
					onmouseout="this.bgColor='#FFFFFF';">
					<%
						}
					%>

					<td align="center">
						<bean:write name="module" property="codeM" />
					</td>
					<td align="center">
						<bean:write name="module" property="libellem" />
					</td>

					<td align="center">
						<html:link href="moduleEdit.do" paramName="module"
							paramProperty="codeM" paramId="codeM">
							<html:img page="/images/edit.gif" title="Modifier" />
						</html:link>

					</td>


					<td align="center">
						<html:link href="moduleDelete.do" paramName="module"
							paramProperty="codeM" paramId="codeM"
							onclick="return confirm('Etes-vous sûr de vouloir supprimer ce module ?')">
							<html:img page="/images/supprimer.gif" title="Supprimer" />
						</html:link>
					</td>
				</tr>

			</logic:iterate>

		</table>
	</logic:present>
</div>
<ajax:select baseUrl="efpDirectionAjax.do" source="codeDr"
	target="codeEfp" parameters="codeDr={codeDr}" />

<ajax:select baseUrl="filiereEFPAjax.do" source="codeEfp"
	target="codeFiliere" parameters="codeEfp={codeEfp}" />

<ajax:select baseUrl="modulefiliereAjax.do" source="codeFiliere"
	target="codeM" parameters="codeFiliere={codeFiliere}" />



Merci d'avoir m'aider à résoudre ce prolème
A voir également:

3 réponses

linkcr15 Messages postés 362 Date d'inscription mercredi 7 janvier 2009 Statut Membre Dernière intervention 31 mars 2016 12
Modifié par linkcr15 le 15/05/2012 à 15:07
ILLISIBLE!
0
Bonjour,

Merci de m'avoir répondu,

Je suis très désolée car j'ai déjà mis mon code entre les deux balises du code mais ça ne marche pas ici
0
linkcr15 Messages postés 362 Date d'inscription mercredi 7 janvier 2009 Statut Membre Dernière intervention 31 mars 2016 12
15 mai 2012 à 16:23
Si elles sont entre balise mais il y a trop de code, c'est complétement illisible sur le site. Essaie d'héberger ton projet ici : https://www.cjoint.com/ ainsi on pourra travailler dessus sans se faire mal aux yeux, merci.
0