?
Solved

html:link in a logic:iterate, how pass param to html:link, to update the data given by the user, by default i put the data from database

Posted on 2008-10-30
11
Medium Priority
?
828 Views
Last Modified: 2013-11-24
i get a list of row from data base
and i iterate through every row , by logic:iterate
in first case , i show information of every column, in <bean:write> or nested:write
once , the user click on edit link
i refresh the page , and every column become editable , <html:text>
so the problem is , how can i pass the modifications of the user in every link
i use a hashmap, and added it to html:link
but in this case , i pass data that i got from database , not the modification of the user
in every column
thank you for your help
0
Comment
Question by:laes_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 2
11 Comments
 
LVL 2

Author Comment

by:laes_
ID: 22848531
here is the code

<logic:notEqual name="userIt" property="userEditMode" value="0">
						<td
							style="width: 615px; border-right: #d8e4f8 1px solid; border-top: #d8e4f8 1px solid; border-left: #d8e4f8 1px solid; border-bottom: #d8e4f8 1px solid; background-color: #d8e4f8; height: 24px;">
						&nbsp; <span style="font-size: 10pt"> <html:text
							property="userNom" style="width: 132px" name="userIt" /></span></td>
						<td
							style="width: 23004px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: left;">
						<span style="font-size: 10pt"> <html:text
							style="width: 127px" name="userIt" property="userPrenom" /></span></td>
						<td
							style="width: 9113px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: center;">
						<span style="font-size: 10pt"> <html:text
							style="width: 63px" name="userIt" property="userIdentifiant" /></span></td>
						<td
							style="width: 10320px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: center;">
						<span style="font-size: 10pt"> <html:text
							style="width: 63px" name="userIt" property="userPwd" /></span></td>
						<td
							style="width: 15787px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: center;">
						<span style="font-size: 10pt"> <nested:root name="userIt">
							<nested:nest property="profil">
								<nested:select property="profilId">
									<nested:optionsCollection name="userEditForm"
										property="profilsList" value="profilId" label="profilLabel" />
								</nested:select>
							</nested:nest>
						</nested:root> </span></td>
						<td
							style="border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; width: 4299px; border-bottom: #f0f8ff 1px solid; height: 26px; background-color: #f0f8ff">
						<span style="font-size: 10pt"> <nested:root name="userIt">
							<nested:nest property="statut">
								<nested:select property="statutId">
									<nested:optionsCollection name="userEditForm"
										property="statutsList" value="statutId" label="statutLabel" />
								</nested:select>
							</nested:nest>
						</nested:root> </span></td>
 
						<bean:define id="uNom" name="userIt" property="userNom" />
						<bean:define id="uPrenom" name="userIt" property="userPrenom" />
						<bean:define id="uIdentifiant" name="userIt"
							property="userIdentifiant" />
						<bean:define id="uPwd" name="userIt" property="userPwd" />
						
						<%
								java.util.HashMap params = new java.util.HashMap();
								params.put("userNom", uNom);
								params.put("userPrenom", uPrenom);
								params.put("userIdentifiant", uIdentifiant);
								params.put("userPwd", uPwd);
								//params.put("UserProfilLabel", uProfil);
								//params.put("statutLabel", ustatutLabel);
								pageContext.setAttribute("paramsName", params);
						%>
						<td
							style="width: 7098px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px;">
						&nbsp; <html:link
							action="EditUsers.do?do=updateUser&userEditMode=0"
							name="paramsName">
							<img src="img\valid.jpg" style="width: 20px" />
						</html:link></td>
					</logic:notEqual>

Open in new window

0
 
LVL 2

Author Comment

by:laes_
ID: 22861153
any one has an idea

Thanks in advance
0
 
LVL 2

Author Comment

by:laes_
ID: 22896686
I am running out of solutions, Can any one please help me !!!! help!!!!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:boonleng
ID: 22901423
Using HashMap to set the parameters on the link is done on the server side not on the client browser, if you need to pass the modified value to the link, you need to use javascript to get the value from the form input and set the the link.
Example:
<a href="#" onclick="window.location='EditUsers.do?do=updateUser&userEditMode=0' + '&userNom=' + document.getElementById('userNom')">
<html:image src="img/valid.jpg" /></a>


A much better way is to submit the value using form post. There's a limit of characters you can pass using GET in link, and form post is much secure as the data won't store in the browser url history.
Example:
<logic:notEqual name="userIt" property="userEditMode" value="0">
      <html:form action="EditUsers.do?do=updateUser&userEditMode=0">
        ...
        <td><html:image src="img/valid.jpg" /></td>
    </html:form>
</logic:notEqual>
0
 
LVL 2

Author Comment

by:laes_
ID: 22902379
ok , i will test the first example
but just one question before :
a several rows so, for eache row, there is userNom, userPrenom ... etc
when i use userNom=' + document.getElementById('userNom')", does this recognize
the good text field , in the good row
0
 
LVL 2

Author Comment

by:laes_
ID: 22902390
just one remark, in front of every row there a  <html:link action="EditUsers.do?do=updateUser&userEditMode=0 ...
the code i post is just for one row, and is inside a nested:iterate
0
 
LVL 14

Expert Comment

by:boonleng
ID: 22910929
If your grid only have one row of fields enabled then you should be able to get the value using the above javascript. if the grid have multiple row of fields then you need to specified the unique name/id for the field or wrap each row with <html:form> and get the fields of the form of that row .

Using the second way(form post) reduce the amount of work constructing the url in javascript.
0
 
LVL 2

Author Comment

by:laes_
ID: 22920377
boonleng,
thanks for your response
i tried tu use the nested:form inside the nested:iterate
i tried it firstly, for an easy  example , without nested proprieties :
here is the code
but when i submit the form of one row, there is no data sent to the bean !, all properties are null

Regard
laes_

			<logic:notEmpty name="familleComptableEditForm"
				property="familleComptables">
				<nested:iterate id="famComptIt" name="familleComptableEditForm"
					property="familleComptables" indexId="testId"
					type="com.thales.project.FamilleComptable">
					<% java.util.HashMap<String,Object> params = new java.util.HashMap<String,Object>(); %>
 
					<tr>
							<logic:notEqual name="famComptIt" property="famEditMode" value="0">
						<nested:form action="EditFamCompt.do?do=updateFamilleComptable&famEditMode=0" >
													<td
								style="width: 4140px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
							<span style="font-size: 10pt"> <nested:text
								style="width: 132px" property="famCode" name="famComptIt" indexed="true"/></span></td>
							<td
								style="width: 12707px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
							<span style="font-size: 10pt"> <nested:text
								style="width: 132px" property="famDesc" name="famComptIt" indexed="true"/></span></td>
							<td
								style="width: 10881px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
							<span style="font-size: 10pt"> <nested:text
								style="width: 132px" property="famFicheAff" name="famComptIt" indexed="true"/></span></td>
							<td
								style="width: 5309px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
							<span style="font-size: 10pt"> <nested:text
								style="width: 132px" property="famReport2" name="famComptIt" indexed="true"/></span></td>
							<td
								style="width: 6104px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
							<span style="font-size: 10pt">&nbsp;<nested:text indexed="true"
								style="width: 132px" property="famReport3" name="famComptIt" /></span></td>
 
 
 
							<td
								style="width: 7098px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px;">
							&nbsp;<%--html:link
								action="EditFamCompt.do?do=updateFamilleComptable&famEditMode=0"
								name="paramsName">
								<img src="img\valid.jpg" style="width: 20px" />
							</html:link--%>
							<nested:submit indexed="true" >valider</nested:submit>
							</td>
							</nested:form>
						</logic:notEqual>
					</tr>
 
				</nested:iterate>
 
 
			</logic:notEmpty>

Open in new window

0
 
LVL 2

Author Comment

by:laes_
ID: 22920584
here is the html generated !

<tr>
<form name="familleComptableEditForm" method="post" action="/FirstProject/EditFamCompt.do?do=updateFamilleComptable">
<td
style="width: 4140px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[0].famCode" value="sss" style="width: 132px"></span></td>
<td
style="width: 12707px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[0].famDesc" value="sss" style="width: 132px"></span></td>
<td
style="width: 10881px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[0].famFicheAff" value="s" style="width: 132px"></span></td>
<td
style="width: 5309px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[0].famReport2" value="s" style="width: 132px"></span></td>
<td
style="width: 6104px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt">&nbsp;<input type="text" name="famComptIt[0].famReport3" value="s" style="width: 132px"></span></td>
<td
style="width: 7098px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px;">
&nbsp;
<input type="submit" name="[0]" value="valider">
</td>
</form>
 
</tr>
<tr>
<form name="familleComptableEditForm" method="post" action="/FirstProject/EditFamCompt.do?do=updateFamilleComptable">
<td
style="width: 4140px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[1].famCode" value="d" style="width: 132px"></span></td>
<td
style="width: 12707px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[1].famDesc" value="d" style="width: 132px"></span></td>
<td
style="width: 10881px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[1].famFicheAff" value="d" style="width: 132px"></span></td>
<td
style="width: 5309px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[1].famReport2" value="d" style="width: 132px"></span></td>
<td
style="width: 6104px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt">&nbsp;<input type="text" name="famComptIt[1].famReport3" value="d" style="width: 132px"></span></td>
<td
style="width: 7098px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px;">
&nbsp;
<input type="submit" name="[1]" value="valider">
</td>
</form>
 
</tr>
<tr>
<form name="familleComptableEditForm" method="post" action="/FirstProject/EditFamCompt.do?do=updateFamilleComptable">
<td
style="width: 4140px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[2].famCode" value="fam1" style="width: 132px"></span></td>
<td
style="width: 12707px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[2].famDesc" value="desc1" style="width: 132px"></span></td>
<td
style="width: 10881px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[2].famFicheAff" value="a" style="width: 132px"></span></td>
<td
style="width: 5309px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[2].famReport2" value="r" style="width: 132px"></span></td>
<td
style="width: 6104px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt">&nbsp;<input type="text" name="famComptIt[2].famReport3" value="y" style="width: 132px"></span></td>
<td
style="width: 7098px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px;">
&nbsp;
<input type="submit" name="[2]" value="valider">
</td>
</form>
</tr>
<tr>
<form name="familleComptableEditForm" method="post" action="/FirstProject/EditFamCompt.do?do=updateFamilleComptable">
<td
style="width: 4140px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[3].famCode" value="fam3" style="width: 132px"></span></td>
<td
style="width: 12707px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[3].famDesc" value="desc3" style="width: 132px"></span></td>
<td
style="width: 10881px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[3].famFicheAff" value="s" style="width: 132px"></span></td>
<td
style="width: 5309px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt"> <input type="text" name="famComptIt[3].famReport2" value="k" style="width: 132px"></span></td>
<td
style="width: 6104px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px; text-align: left;">
<span style="font-size: 10pt">&nbsp;<input type="text" name="famComptIt[3].famReport3" value="t" style="width: 132px"></span></td>
 
<td
style="width: 7098px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 25px;">
&nbsp;
<input type="submit" name="[3]" value="valider">
</td>
</form>
 
</tr> 

Open in new window

0
 
LVL 2

Author Comment

by:laes_
ID: 22951644
i maked some changes in the form : here is the jsp
now i can modify the first and las row
but , it doesn't make change in the intermediate row
i create for every row , one submit property
and added a setter and getter method in user bean
here is the code of the jsp and the getter and setter method

Regards
laes_
 
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
 
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-nested" prefix="nested"%>
 
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>CPFA - Gestion des Utilisateurs</title>
<script type="text/javascript" language="javascript"
	src="Javascript\menu.js"></script>
<script type="text/javascript" language="javascript"
	src="Javascript\config.js"></script>
<script type="text/javascript" language="javascript"
	src="Javascript\data.js"></script>
<link href="css\valeo.css" rel="stylesheet" type="text/css">
</head>
<body style="text-align: right">
<script language="javascript"> 
<!--     
function champsok()     
{
if (document.forms[0].elements["userIdentifiant"].value.length == 0)
 {
 alert("Le champs Identifiant ne doit pas etre vide.");
  document.forms[0].elements["userIdentifiant"].focus()
 return false;
 }
 else if(document.forms[0].elements["userPwd"].value.length ==0 )
{
 alert("Le champs mot de passe ne doit pas etre vide.");
 document.forms[0].elements["userPwd"].focus()
 return false;
 }
  return true;
  }
 -->
</script>
 
<table cellpadding="0" cellspacing="0" width="100%" border=1
	bordercolor="#3B72A5">
	<tr bgcolor="#FFFFFF">
		<td height=1 valign=middle><img src="img\FondMenuHaut.jpg"
			vspace=0 style="width: 900px"></td>
	</tr>
	<tr>
		<td bgcolor="#508ECC" valign="bottom" style="text-align: left"><script
			type="text/javascript">
            var isHorizontal=1;
            var fontColor=["#FFFFFF","#FFFFFF"];
			var itemBackColor=["#508ECC","#3B72A5"];
			var itemBorderColor=["#508ECC","#508ECC"];
			var fontStyle="8pt Arial bold";
			var menuBackColor="#508ECC";
			var menuBorderColor="#508ECC";
            MenuDyn_init();
        </script></td>
	</tr>
	<tr>
		<td style="text-align: center">
		<table width="100%">
			<tr>
				<td style="height: 27px; text-align: center" colspan="3"><strong><span
					style="color: #330099"><span style="color: #508ECC">
				<span style="font-size: 14pt"> <br />
				<span style="font-size: 12pt; color: #000099;"> CPFA -
				Gestion des Utilisateurs</span></span></span></span></strong></td>
			</tr>
		</table>
		
		<table border="0" cellpadding="0" cellspacing="0"
			style="border-right: #508ECC 1px solid; border-top: #508ECC 1px solid; border-left: #508ECC 1px solid; border-bottom: #508ECC 1px solid">
			<tr>
				<td
					style="border-right: #508ECC 1px solid; border-top: #508ECC 1px solid; border-left: #508ECC 1px solid; width: 9543px; border-bottom: #508ECC 1px solid; height: 24px; background-color: #508ECC; text-align: left;">
				<span style="font-size: 10pt; color: #ffffff"><strong>Nom</strong></span></td>
				<td
					style="border-right: #508ECC 1px solid; border-top: #508ECC 1px solid; border-left: #508ECC 1px solid; width: 23004px; border-bottom: #508ECC 1px solid; height: 24px; background-color: #508ECC; text-align: left;">
				<span style="font-size: 10pt; color: #ffffff"><strong>Prénom</strong></span></td>
				<td
					style="border-right: #508ECC 1px solid; border-top: #508ECC 1px solid; border-left: #508ECC 1px solid; width: 9113px; border-bottom: #508ECC 1px solid; height: 24px; background-color: #508ECC; text-align: center;">
				<strong><span style="font-size: 10pt; color: #ffffff">Identifiant</span></strong></td>
				<td
					style="border-right: #508ECC 1px solid; border-top: #508ECC 1px solid; border-left: #508ECC 1px solid; width: 10320px; border-bottom: #508ECC 1px solid; height: 24px; background-color: #508ECC; text-align: center;">
				<span style="font-size: 10pt; color: #ffffff"><strong>Mot
				de passe</strong></span></td>
				<td
					style="border-right: #508ECC 1px solid; border-top: #508ECC 1px solid; border-left: #508ECC 1px solid; width: 15787px; border-bottom: #508ECC 1px solid; height: 24px; background-color: #508ECC; text-align: center;">
				<span style="font-size: 10pt; color: #ffffff"><strong>Profil</strong></span></td>
				<td
					style="border-right: #508ECC 1px solid; border-top: #508ECC 1px solid; border-left: #508ECC 1px solid; width: 4299px; border-bottom: #508ECC 1px solid; height: 24px; background-color: #508ECC">
				<strong><span style="font-size: 10pt; color: #ffffff">Statut</span></strong></td>
				<td
					style="border-right: #508ECC 1px solid; border-top: #508ECC 1px solid; border-left: #508ECC 1px solid; width: 299px; border-bottom: #508ECC 1px solid; height: 24px; background-color: #508ECC">
				&nbsp;</td>
			</tr>
			<logic:empty property="users" name="userEditForm">
			<tr>
				<td colspan="5">No users available</td>
			</tr>
		</logic:empty>
		<logic:notEmpty property="users" name="userEditForm" >
		<nested:form action="EditUsers.do?do=ListUsers">
			<nested:iterate  property="users">
																	<tr>
					<nested:equal property="userEditMode" value="0">
					
						<td
							style="width: 9543px; border-right: #d8e4f8 1px solid; border-top: #d8e4f8 1px solid; border-left: #d8e4f8 1px solid; border-bottom: #d8e4f8 1px solid; background-color: #d8e4f8; text-align: left; height: 24px;">
						<span style="font-size: 10pt"><nested:write property="userNom" /></span></td>
						<td
							style="width: 23004px; border-right: #d8e4f8 1px solid; border-top: #d8e4f8 1px solid; border-left: #d8e4f8 1px solid; border-bottom: #d8e4f8 1px solid; background-color: #d8e4f8; text-align: left; height: 24px;">
						<span style="font-size: 10pt"><nested:write property="userPrenom" /></span></td>
						<td
							style="width: 9113px; border-right: #d8e4f8 1px solid; border-top: #d8e4f8 1px solid; border-left: #d8e4f8 1px solid; border-bottom: #d8e4f8 1px solid; background-color: #d8e4f8; text-align: center; height: 24px;">
						<span style="font-size: 10pt"><nested:write property="userIdentifiant" /></span></td>
						<td
							style="width: 10320px; border-right: #d8e4f8 1px solid; border-top: #d8e4f8 1px solid; border-left: #d8e4f8 1px solid; border-bottom: #d8e4f8 1px solid; background-color: #d8e4f8; text-align: center; height: 24px;">
						<span style="font-size: 10pt"><nested:write 						property="userPwd" /></span></td>
						<td
							style="width: 15787px; border-right: #d8e4f8 1px solid; border-top: #d8e4f8 1px solid; border-left: #d8e4f8 1px solid; border-bottom: #d8e4f8 1px solid; background-color: #d8e4f8; height: 24px; text-align: center;">
						<span style="font-size: 10pt"></span> 
							<nested:nest property="profil">
								<nested:write property="profilLabel" />
							</nested:nest>
						</td>
						<td
							style="border-right: #d8e4f8 1px solid; border-top: #d8e4f8 1px solid; border-left: #d8e4f8 1px solid; width: 4299px; border-bottom: #d8e4f8 1px solid; background-color: #d8e4f8; height: 24px; text-align: center;">
						<span style="font-size: 10pt">
							<nested:nest property="statut">
								<nested:write property="statutLabel" />
							</nested:nest>
						</span></td>
												
						<td
							style="width: 7098px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px;">
						&nbsp;<nested:submit property="editUserButton" >modifier</nested:submit></td>
												
					</nested:equal>
					<nested:notEqual  property="userEditMode" value="0">
					
						<td
							style="width: 615px; border-right: #d8e4f8 1px solid; border-top: #d8e4f8 1px solid; border-left: #d8e4f8 1px solid; border-bottom: #d8e4f8 1px solid; background-color: #d8e4f8; height: 24px;">
						&nbsp; <span style="font-size: 10pt"> <nested:text
							property="userNom" style="width: 132px"  /></span></td>
						<td
							style="width: 23004px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: left;">
						<span style="font-size: 10pt"> <nested:text 
							style="width: 127px"  property="userPrenom" /></span></td>
						<td
							style="width: 9113px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: center;">
						<span style="font-size: 10pt"> <nested:text
							style="width: 63px" property="userIdentifiant" maxlength="8" /></span></td>
						<td
							style="width: 10320px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: center;">
						<span style="font-size: 10pt"> <nested:text
							style="width: 63px" property="userPwd" maxlength="8"/></span></td>
						<td
							style="width: 15787px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: center;">
						<span style="font-size: 10pt"> 
							<nested:nest property="profil">
								<nested:select property="profilId">
									<nested:optionsCollection name="userEditForm"
										property="profilsList" value="profilId" label="profilLabel" />
								</nested:select>
								</nested:nest>
							
						</span></td>
						<td
							style="border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; width: 4299px; border-bottom: #f0f8ff 1px solid; height: 26px; background-color: #f0f8ff">
						<span style="font-size: 10pt">
						<nested:nest property="statut"> 
															<nested:select property="statutId">
									<nested:optionsCollection name="userEditForm"
										property="statutsList" value="statutId" label="statutLabel" />
								</nested:select>
								</nested:nest>
							
						 </span></td>
						<td
							style="width: 7098px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px;">
						&nbsp; 
						<nested:submit property="updateUserButton" >valider</nested:submit>
						</td>
					</nested:notEqual>
				</tr>
				</nested:iterate>
				</nested:form>
			</logic:notEmpty>
			<tr>
				<html:form action="EditUsers.do?do=addUser" onsubmit="return champsok()">
				
					<td
						style="width: 615px; border-right: #d8e4f8 1px solid; border-top: #d8e4f8 1px solid; border-left: #d8e4f8 1px solid; border-bottom: #d8e4f8 1px solid; background-color: #d8e4f8; height: 24px;">
					<span style="font-size: 10pt"> <nested:text 
						property="userNom" style="width: 132px" /></span></td>
					<td
						style="width: 23004px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: left;">
					<span style="font-size: 10pt"> <nested:text
						style="width: 127px"  property="userPrenom" /></span></td>
					<td
						style="width: 9113px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: center;">
					<span style="font-size: 10pt"> <nested:text
						style="width: 63px"  property="userIdentifiant"
						/></span></td>
					<td
						style="width: 10320px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: center;">
					<span style="font-size: 10pt"> <nested:text
						style="width: 63px" property="userPwd" /></span></td>
												
					<td
						style="width: 15787px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: center;">
					<span style="font-size: 10pt"> </span>
					
						<nested:nest property="profil">	
						<nested:select property="profilId" >
								<nested:optionsCollection name="userEditForm"
									property="profilsList" value="profilId" label="profilLabel" />
							</nested:select>
							</nested:nest>
							
																</td>
 
					<td
						style="border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; width: 4299px; border-bottom: #f0f8ff 1px solid; height: 26px; background-color: #f0f8ff">
					<span style="font-size: 10pt"> 
					<nested:nest property="statut">
						<nested:select property="statutId" >
								<nested:optionsCollection name="userEditForm"
									property="statutsList" value="statutId" label="statutLabel" />
							</nested:select>
							</nested:nest>
						
					 </span></td>
					 										<td
						style="width: 7098px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px;">
					&nbsp;<nested:submit>ajouter</nested:submit></td>
					<nested:hidden property="userEditMode" value="0" />
					
				</html:form>
			</tr>
 
		</table>
		
	</tr>
 
</table>
</body>
</HTML>
 
 
// getter and setter
 
 public void setUpdateUserButton(String empty) {
		    this.setUserEditMode(new Integer(0));
		    HibernateUtilisateurDAO dao=new HibernateUtilisateurDAO();
		    dao.updateUtilisateurDAO(this);
		  }
		 public void setEditUserButton(String empty) {
		    this.setUserEditMode(new Integer(5));
		    HibernateUtilisateurDAO dao=new HibernateUtilisateurDAO();
		    dao.updateUtilisateurDAO(this);
		  }

Open in new window

0
 
LVL 2

Accepted Solution

by:
laes_ earned 0 total points
ID: 23052126
here is the solution i developped
i make a sumbit with a property updateUserButton
and in the set method of this property
i called the update method


            

					<nested:notEqual  property="userEditMode" value="0">
					<nested:hidden property="userId"/>
						<td
							style="width: 615px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 24px;">
						&nbsp; <span style="font-size: 10pt"> <nested:text
							property="userNom" style="width: 132px"  /></span></td>
						<td
							style="width: 23004px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: left;">
						<span style="font-size: 10pt"> <nested:text 
							style="width: 127px"  property="userPrenom" /></span></td>
						<td
							style="width: 9113px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: center;">
						<span style="font-size: 10pt"> <nested:text
							style="width: 63px" property="userIdentifiant" maxlength="8" /></span></td>
						<td
							style="width: 10320px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: center;">
						<span style="font-size: 10pt"> <nested:text
							style="width: 63px" property="userPwd" maxlength="8"/></span></td>
						<td
							style="width: 15787px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px; text-align: center;">
						<span style="font-size: 10pt"> 
							<nested:nest property="profil">
								<nested:select property="profilId">
									<html:optionsCollection property="profilsList" name="userEditForm" value="profilId" label="profilLabel" />
								</nested:select>
								</nested:nest>
							
						</span></td>
						<td
							style="border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; width: 4299px; border-bottom: #f0f8ff 1px solid; height: 26px; background-color: #f0f8ff">
						<span style="font-size: 10pt">
						<nested:nest property="statut"> 
															<nested:select property="statutId">
									<html:optionsCollection property="statutsList" name="userEditForm" value="statutId" label="statutLabel" />
								</nested:select>
								</nested:nest>
							
						 </span></td>
						<td
							style="width: 7098px; border-right: #f0f8ff 1px solid; border-top: #f0f8ff 1px solid; border-left: #f0f8ff 1px solid; border-bottom: #f0f8ff 1px solid; background-color: #f0f8ff; height: 26px;">
						&nbsp; 
						<nested:submit property="updateUserButton" >valider</nested:submit>
						
						</td>
					</nested:notEqual>

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question