Salut, j'ai une page jsf qui contient un rich:dataGrid qui affiche des données de ma base. Dans chaque h:panelGrid (qui représente une ligne de mon datagrid) , j'ai un commandLink qui me permet d'afficher un rich:modalPanel lors du click.

Mon problème c'est que lorsque je clique sur le bouton, mon modalPanel s'affiche seulement durant quelques instants puis il disparaît. La cause de ce problème c'est que lorsque je clique sur le bouton, la page se ré-affiche n fois (avec n le nombre d'enregistrements que j'ai dans ma base).

S'il vous plaît est ce qu'il ya une astuce pour ne relancer la page qu'après la fermeture du rich:modalPanel???

voici le contenu de ma page :
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
 
<rich:panel id="richPanel1">
			<h:form id="formulairePanier">
 
				<rich:panel id="richPanel2">
					<f:facet name="header">
						<h:outputText id="titreSousCateg"
							value=" *** Les produits commandés *** "></h:outputText>
 
					</f:facet>
 
 
					<rich:dataGrid value="#{ligneDeCommandeBean.tousLignes}"
						var="lignes" columns="1" elements="8" width="600px" id="dataGrid">
						<center>
							<h:outputText
								value="Prix total du panier : #{ligneDeCommandeBean.prixTotalPanier}"
								style="FONT-SIZE: small; FONT-WEIGHT: bold; COLOR: #ff0080;" />
						</center>
 
 
						<rich:panel bodyClass="pbody">
							<f:facet name="header">
								<h:outputText value=" *** "></h:outputText>
							</f:facet>
							<h:panelGrid columns="2" id="panelGrid">
								<h:outputText value="N° du Panier : " styleClass="label"></h:outputText>
								<h:outputText value="#{lignes.panier.idPan}" />
								<h:outputText value="le Client : " styleClass="label"></h:outputText>
								<h:outputText value="#{lignes.client.login}" />
								<h:outputText value="le Produit : " styleClass="label"></h:outputText>
								<h:outputText value="#{lignes.produit.libeleProd}" />
								<h:outputText value="Prix du Produit : " styleClass="label"></h:outputText>
								<h:outputText value="#{lignes.produit.prixProd}" />
								<h:outputText value="Quantité : " styleClass="label"></h:outputText>
 
								<h:outputText value="#{lignes.quantComm}" id="qt"
									submitMode="ajax" var="jj">
 
								</h:outputText>
								<h:outputText value="Prix Total " styleClass="label"></h:outputText>
								<h:outputText value="#{lignes.prixTotQt}" id="pr" />
 
 
 
								 <h:commandLink value="" id="link" style="FONT-WEIGHT: bold; FONT-SIZE: small;">
	        							********** Modifier quantité **********
		        					<rich:componentControl for="modal1" attachTo="link"
										operation="show" event="onclick" />
 
									<f:setPropertyActionListener
										target="#{ligneDeCommandeBean.id_prod}"
										value="#{lignes.produit.idProd}" />
 
									<f:setPropertyActionListener
										target="#{ligneDeCommandeBean.libProduit}"
										value="#{lignes.produit.libeleProd}" />
 
									<f:setPropertyActionListener
										target="#{ligneDeCommandeBean.prixUnitaire}"
										value="#{lignes.produit.prixProd}" />
									<f:setPropertyActionListener
										target="#{ligneDeCommandeBean.quantite}"
										value="#{lignes.quantComm}" />
								</h:commandLink>
 
 
 
							</h:panelGrid>
						</rich:panel>
					</rich:dataGrid>
					<center>
						<h:outputText
							value="Prix total du panier : #{ligneDeCommandeBean.prixTotalPanier}"
							style="FONT-SIZE: small; FONT-WEIGHT: bold; COLOR: #ff0080;" />
					</center>
				</rich:panel>
			</h:form>
 
		</rich:panel>
et le code du modalPanel :
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
 
<rich:modalPanel id="modal1" width="600" height="200">
 
			<f:facet name="header">
				<h:panelGroup>
					<h:outputText value="Modification de la quantité du produit" />
				</h:panelGroup>
			</f:facet>
 
			<f:facet name="controls">
				<h:panelGroup>
					<h:graphicImage value="/images/close.gif" styleClass="hidelink"
						id="hidelink" />
					<rich:componentControl for="modal1" attachTo="hidelink"
						operation="hide" event="onclick" />
				</h:panelGroup>
			</f:facet>
 
			<h:form>
 
					<h:outputText value ="Produit : + #{ligneDeCommandeBean.libProduit}"/>
					<br></br>
					<h:outputText value ="Produit : + #{ligneDeCommandeBean.prixUnitaire}"/>
					<h:outputText
						value="saisir la nouvelle quantité puis cliquez sur valider : "
						style="COLOR: #0080c0; FONT-WEIGHT: bold; FONT-SIZE: small;" />
 
					<h:commandButton value="Valider"
						action="#{ligneDeCommandeBean.reCalculerPrix}">
					</h:commandButton>
 
					<rich:inputNumberSpinner id="nouvValeurQte"
						value="#{ligneDeCommandeBean.quantite}" style=" width : 118px;"></rich:inputNumberSpinner>
 
 
				</h:form>
J'attends vos réponses, merci d'avance.