IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Servlets/JSP Java Discussion :

Mask de saisie JSP


Sujet :

Servlets/JSP Java

  1. #1
    Membre à l'essai
    Inscrit en
    Juillet 2010
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Juillet 2010
    Messages : 74
    Points : 15
    Points
    15
    Par défaut Mask de saisie JSP
    Bonjour,

    Tabord j'espère que vous pourrez m'aider. Mon problème es le suivant :

    J'ai des champs de saisies, et je peux que l'utilisateur ne puissent saisir dans ces champs que des chiffres.

    J'ai trouver un lien pour faire cela mais cela ne marche pas.

    Lien :

    http://coldjava.hypermart.net/servlets/maskedinput.htm

    Code JSP:
    Code xml : 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
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
     
     
    <!-- Import nécessaire -->
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
     
    <%@ taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
    <%@ taglib prefix="rich" uri="http://richfaces.org/rich" %>
    <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
    <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
     
     
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
     
     
    <%@page import="CSCI_SB.CSC_GDB.CSC_CONSULTATION.CoutobjectifachatBean"%>
     
     
    <html>
     
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <meta http-equiv="Content-Style-Type" content="text/css" />
        <link rel="stylesheet" type="text/css" href="css.css" />
     
        <!-- Titre en haut de la page -->
    	<title>THOT : Mandat</title>
     
    <script language="Javascript1.2" type="text/javascript">
     
     
    function Chargement() {
     
    }
     
    </script>
     
     
    </head>
    <body onLoad="Chargement();">
     
    <f:view>
     
    <!-- L'en-tête -->
        <div id="logoThales" ></div>
        <div id="entete">
        	<strong class="important">TH</strong>alès <strong class="important">O</strong>util de sous-<strong class="important">T</strong>raitance <img src="img/thot.jpg" style="position:absolute;top:5px;left:1050px;" width=35 height=7%>
        </div>
     
         <!-- Partie connexion avec la date -->
        <div id="connexion">
        <h:form>
           <strong><h:outputText value="#{connexionBean.utilisateur.nom}" /><rich:spacer width="5" /><h:outputText value="#{connexionBean.utilisateur.prenom}" /> | <h:outputLink value="modifierCompte.jsf"><h:outputText value="Compte" /></h:outputLink> | <h:commandLink action="#{connexionBean.deconnexion}" immediate="true" value="Déconnexion" />| <script type="text/javascript" src="date.js"></script></strong>
    	</h:form>
        </div>
     
         <!-- Les menus -->
        <div id="menu">
        	<f:subview id="menuSub">
     
    			<%@ include file="menu.jsp" %>
    		</f:subview>
        </div>
     
        <!-- Le corps -->
     
     
     
    	    <div id="action"></div>
    		    <div id="corps">
     
    				<div id="coutobjectifachat">
     
    					<!-- Titre de la page -->
    					<h2>Détermination du mandat</h2> 
    					<center>(Cout cible pour une sous-traitance de développement) </center> 				 
     
    					<!-- Espace de 30px entre le titre et le formulaire -->
    					<rich:spacer height="30px" />					 
     
    					<h:form id="BesoinForm" style="width: 100%;" >
     
     
     
    						<h:panelGrid columns="6" >						
    							<h:outputLabel><font><h:outputText value="Affaire : "/></font></h:outputLabel>
     
     
    						<!-- Choisir une affaire dans la liste déroulante -->
    					<h:selectOneMenu id="affaire" value="#{CoutobjectifachatBean.idAffaire}" >
    						<f:selectItems value="#{CoutobjectifachatBean.listAffaire}" />
    						<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.affaireByID}" reRender="projet" />
    					</h:selectOneMenu>
     
     
    					<h:outputLabel><font><h:outputText value="Sous-ensemble : "/></font></h:outputLabel>
     
    					<h:selectOneMenu id="projet" value="#{CoutobjectifachatBean.idProjet}"  >
    						<f:selectItem itemValue="0" itemLabel="Choisir un projet"/>
    						<f:selectItems  value="#{CoutobjectifachatBean.listProjettrie}"/>	
    						<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.projetByID}" reRender="besoinSelectMenu" />					
    					</h:selectOneMenu>		
     
    					<h:outputLabel><font><h:outputText value="Selection du Besoin : "/></font></h:outputLabel>
    					<h:selectOneMenu id="besoinSelectMenu" value="#{CoutobjectifachatBean.id}" converter="javax.faces.Integer">
    						<f:selectItems value="#{CoutobjectifachatBean.listBesointrie}" />
    						<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.besoinByID}" reRender="worknomcharge,chargetransverse,risqueslitigesmontant,opprotunitesmontant,chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseur,suivifournisseureuros,suivifournisseurjours,tjmtas,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coef,coefk" />
    					</h:selectOneMenu>
    					<h:message showDetail="true" style="color: red; text-decoration: none;" id="messageBesoin" for="besoinSelectMenu" />
     
    						</h:panelGrid>	
     
    						<rich:spacer height="20px" /> 
     
    						<rich:panel header="" style="width:980px;">	
     
    							<h:outputLabel><font><center><h:outputText value="Montant chargé provisionné pour le développement par TAS :" style="color:orange;font-size:15px"/></center></font></h:outputLabel>
    							<br/>
    							<br/>							
    							<h:outputLabel><font><u><h:outputText value="MAKE : Si les travaux sont fait pour TSA" /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<!-- Petit panel de 3 colonnes où dans chaque colonne est placé un composant -->
    							<h:panelGrid columns="7" >	
    								<h:outputLabel><font><h:outputText value="WorkLoad non chargé (Implémentation, Soutien, Conception, Qualification) " /></font><font><h:outputText style="color:red" value="(1) :"/></font></h:outputLabel>							
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>		
    								<h:inputText id="worknomcharge"  value="#{CoutobjectifachatBean.coutcible.worknomcharge}" title= "Charge transverse jours = Worknomcharge * Charge transverse" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>									
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />
     
    								<h:outputLabel><font><h:outputText value="j" /></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
     
    								<!-- Petit composant qui ai une échelle de pourcentage pour choisir la charge transverse, la value de inputNumberSlider sera à modifier -->
    								<h:outputLabel><font><h:outputText value="Charge transverse lié au dév (management, qualité, garantie) "/></font><font><h:outputText style="color:red" value="(2) :"/></font></h:outputLabel>	
    								<h:inputText id="chargetransverse" value="#{CoutobjectifachatBean.coutcible.montantcharge}" title= "Charge transverse jours = Worknomcharge * Charge transverse"><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>		
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />
    								<h:outputLabel><font><h:outputText value="% soit"/></font></h:outputLabel>		
    								<h:inputText id="chargetransversejour"  value="#{CoutobjectifachatBean.coutcible.chargetransversejour}" disabled="true" title= "Charge transverse jours = Worknomcharge * Charge transverse" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>										
    								<h:outputLabel><font><h:outputText value="j " /></font><font><h:outputText style="color:red" value="(4)" title= "Charge transverse jours = Worknomcharge * Charge transverse == (4)=(1)*(2)"/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>		
     
     
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    							    <h:outputLabel><font><h:outputText value="TOTAL :"/></font></h:outputLabel>		
    								<h:inputText id="totaljours"  value="#{CoutobjectifachatBean.coutcible.totaljours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>									
    								<h:outputLabel><font><h:outputText value="j "/></font><font><h:outputText style="color:red" value="(5)" title= "Total jours = Worknomcharge + Charge transverse == (5)=(1)+(2)" /></font></h:outputLabel>
    								<h:inputText id="totalkeur"  value="#{CoutobjectifachatBean.coutcible.totalkeur}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>		
    								<h:outputLabel><font><h:outputText value="EUR "/></font><font><h:outputText style="color:red" value="(6)" title= "Total kEUR = (Worknomcharge + Charge transverse jours)* Tjmeuros == (6)=((1)+(4))*(3)"/></font></h:outputLabel>
     
     
    							</h:panelGrid>	
    							<!-- Fin petit panel -->
    														<!-- Espace de 20px entre le second panel et le troisième-->
    							<rich:spacer height="20" />
     
    							<!-- Petit panel de 4 colonnes où dans chaque colonne est placé un composant -->
    							<h:panelGrid columns="2" >	
     
    								<h:outputLabel><font><h:outputText value="TJM : "/></font></h:outputLabel>
     
    								<!-- Choisir une entite dans la liste déroulante -->
    								<h:selectOneMenu id="tjmtas" value="#{CoutobjectifachatBean.idEntite}" >
    									<f:selectItems value="#{CoutobjectifachatBean.listEntite}" />
    									<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.entiteByID}" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />
    								</h:selectOneMenu>
     
    								<h:outputLabel><font><h:outputText value="TJM en EUR "/></font><font><h:outputText style="color:red" value="(3) :"/></font></h:outputLabel>		
    								<h:inputText id="tjmeuros"  value="#{CoutobjectifachatBean.coutcible.montanttjm}" disabled="true"  />
     
     
    							</h:panelGrid>
    							<!-- Fin petit panel -->
     
     
     
    							<!-- Petite ligne de séparation dans ce composant-->
    							<br/><rich:separator height="2" lineType="solid"/><br/>
     
    							<!-- Petit panel de 7 colonnes où dans chaque colonne est placé un composant -->
     
     
    							<h:panelGrid columns="8" >	
     
    								<!-- Petit composant qui ai une échelle de pourcentage pour choisir la charge transverse, la value de inputNumberSlider sera à modifier -->
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="(+) Risques "/></font></h:outputLabel>	
    								<h:inputText id="risqueslitigesmontant"  value="#{CoutobjectifachatBean.coutcible.risques}"><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>				
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk"/>	
    								<h:outputLabel><font><h:outputText value="% "/></font><font><h:outputText style="color:red" value="(7) "/></font><font><h:outputText value="soit"/></font></h:outputLabel>		
    								<h:inputText id="risqueslitigesjours" value="#{CoutobjectifachatBean.coutcible.risquesjours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>		
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (8) " title= "Risques JOUR = Risques * Total JOUR == (8)=(7)*(5)"/></font></h:outputLabel>	
    								<h:inputText id="risqueslitigesmontanteuros" value="#{CoutobjectifachatBean.coutcible.risqueseuros}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>									
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (9)" title= "Risques kEUR = Risques * Total kEUR == (9)=(7)*(6)"/></font></h:outputLabel>		
     
    								<!-- Petit composant qui ai une échelle de pourcentage pour choisir la charge transverse, la value de inputNumberSlider sera à modifier -->
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="(-) Opportunités "/></font></h:outputLabel>	
    								<h:inputText id="opprotunitesmontant" value="#{CoutobjectifachatBean.coutcible.opportunite}" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>				
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk"/>	
    								<h:outputLabel><font><h:outputText value="% "/></font><font><h:outputText style="color:red" value="(10) "/></font><font><h:outputText value="soit"/></font></h:outputLabel>		
    								<h:inputText id="opprotunitesjours" value="#{CoutobjectifachatBean.coutcible.opportunitejours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>	
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (11) " title= "Opportunites JOUR = Opportunites * Total JOUR == (11)=(7)*(5)"/></font></h:outputLabel>	
    								<h:inputText id="opprotunitesmontanteuros" value="#{CoutobjectifachatBean.coutcible.opportuniteeuros}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>									
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (12)" title= "Opportunites kEUR = Opportunites * Total kEUR == (12)=(10)*(6)"/></font></h:outputLabel>		
     
     
     
     
     
    							<!-- Petite ligne de séparation dans ce composant-->
    								<h:outputLabel><font><h:outputText value="------------------------------------------------"/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="--------------------------------------------------"/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value="--------------------------------"/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value="---------"/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="--------------------------------"/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="-"/></font></h:outputLabel>		
    								<h:outputLabel><font><h:outputText value="--------------------------------"/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="-------"/></font></h:outputLabel>
    							<!-- Petit panel de 3 colonnes où dans chaque colonne est placé un composant -->
     
     
    								<!-- -->
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="MONTANT TOTAL SANS RISQUES"/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:inputText id="montanttotalsansrisquesjours" value="#{CoutobjectifachatBean.coutcible.montanttotalsansrisquesjours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>	
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (5)" title= "Montant total sans risques jours = Worknomcharge + Charge transverse == (5)=(1)+(2)" /></font></h:outputLabel>		
    								<h:inputText id="montanttotalsansrisqueskeur" value="#{CoutobjectifachatBean.coutcible.montanttotalsansrisqueskeur}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>			
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (6)" title= "Montant total sans risques kEUR = (Worknomcharge + Charge transverse jours)* Tjmeuros == (6)=((1)+(4))*(3)"/></font></h:outputLabel>		
     
     
    								<!--  -->
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="MONTANT TOTAL AVEC RISQUES "/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:inputText id="montanttotalavecrisquesjours" value="#{CoutobjectifachatBean.coutcible.montanttotalavecrisquesjours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>	
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (13)" title= "Montant total avec risques jours = Total jours + Risques jours == (13)=(5)+(8)"/></font></h:outputLabel>		
    								<h:inputText id="montanttotalavecrisqueskeur" value="#{CoutobjectifachatBean.coutcible.montanttotalavecrisqueskeur}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>			
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (14)" title= "Montant total avec risques kEUR = Total kEUR + Risques kEUR == (14)=(6)+(9)"/></font></h:outputLabel>		
    							</h:panelGrid>	
     
    						</rich:panel>
    					<rich:panel style="position:relative;bottom:320px;left:-180px;width:160px;border:0">
     
    							<h:outputLabel><font><u><h:outputText value="Aide pour les formules :" /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<h:panelGrid columns="1" >
    							<h:outputLabel><font><h:outputText style="color:red" value="(4)=(1)*(2)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(5)=(1)+(2)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(6)=((1)+(4))*(3)"/></font></h:outputLabel>		
    							</h:panelGrid>	
    					</rich:panel>
    					<rich:panel style="position:relative;bottom:280px;left:-180px;width:160px;border:0">
     
    							<h:outputLabel><font><u><h:outputText value="Aide pour les formules :" /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<h:panelGrid columns="1" >
    							<h:outputLabel><font><h:outputText style="color:red" value="(8)=(7)*(5)"/></font></h:outputLabel>
    							<h:outputLabel><font><h:outputText style="color:red" value="(9)=(7)*(6)"/></font></h:outputLabel>
    							<h:outputLabel><font><h:outputText style="color:red" value="(11)=(7)*(5)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(12)=(10)*(6)"/></font></h:outputLabel>
    							<h:outputLabel><font><h:outputText style="color:red" value="(13)=(5)+(8)-(11)"/></font></h:outputLabel>
    							<h:outputLabel><font><h:outputText style="color:red" value="(14)=(6)+(9)-(12)"/></font></h:outputLabel>	
     
    							</h:panelGrid>	
    					</rich:panel>
    					<rich:panel style="position:relative;bottom:220px;left:-180px;width:160px;border:0">
     
    							<h:outputLabel><font><u><h:outputText value="Aide pour les formules :" /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<h:panelGrid columns="1" >
    							<h:outputLabel><font><h:outputText style="color:red" value="(16)=(17)/(3)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(17)=(15)*(6)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(19)=((14)-(17))/(18)"/></font></h:outputLabel>	
    							</h:panelGrid>	
    					</rich:panel>
     
    					<rich:panel style="position:relative;bottom:330px;left:0px;width:980px;">
     
    							<h:outputLabel><font><u><h:outputText value="BUY : Si les travaux sont  sous traités " /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<!-- Petit panel de 2 colonnes où dans chaque colonne est placé un composant -->
    							<h:panelGrid columns="7" >
     
    								<!-- Petit composant qui ai une échelle de pourcentage pour suivi du fournisseur (FRN), la value de inputNumberSlider sera à modifier -->
    								<h:outputLabel><font><h:outputText value="Part de suivi du FRN par TSA"/></font><font><h:outputText style="color:red" value=" (15) :"/></font></h:outputLabel>	
    								<h:inputText id="suivifournisseur" converter="#{Integer}" required="true" value="#{CoutobjectifachatBean.coutcible.suivifrn}" />								
     
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />														 
    								<h:outputLabel><font><h:outputText value="% soit"/></font></h:outputLabel>					
    								<h:inputText id="suivifournisseurjours" value="#{CoutobjectifachatBean.coutcible.suivifournisseurjours}" disabled="true"  ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>		
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (16)" title= "Suivi FRN jours = Suivi FRN kEUR / Tjmeuros == (16)=(17)/(3)"/></font></h:outputLabel>		
    								<h:inputText id="suivifournisseureuros" value="#{CoutobjectifachatBean.coutcible.suivifournisseureuros}" disabled="true"  ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>				
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (17)" title= "Suivi FRN kEUR = Suivi FRN * Total kEUR == (17)=(15)*(6)"/></font></h:outputLabel>	
     
     
     
     
    								<!-- Petit panel de 4 colonnes où dans chaque colonne est placé un composant -->
    								<h:panelGrid columns="2" >	
     
    									<h:outputLabel><font><h:outputText value="Coef d'appro : "/></font><font><h:outputText style="color:red" value=" (18) :"/></font></h:outputLabel>
     
    									<!-- Choisir une entite dans la liste déroulante -->
    									<h:selectOneMenu id="coef" value="#{CoutobjectifachatBean.idCoefappro}" >
    										<f:selectItems value="#{CoutobjectifachatBean.listCoefappro}" />
    										<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.coefapproByID}" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />
    									</h:selectOneMenu>
     
    									<h:outputLabel><font><h:outputText value="Coef "/></font><font><h:outputText style="color:red" value="(18) :"/></font></h:outputLabel>		
    									<h:inputText id="coefk"  value="#{CoutobjectifachatBean.coutcible.k}" disabled="true"  />
     
     
    								</h:panelGrid>
    								<!-- Fin petit panel -->	
     
     
     
    							</h:panelGrid>	
    							<h:panelGrid columns="3" >	
     
    								<h:outputLabel><font><h:outputText value="PART MAXIMALE (MANDAT)"/></font><font><h:outputText style="color:red" value=" (19) = " title= "MANDAT = (Total kEUR - Suivi FRN kEUR) / Coeff d'appro == (19)=((6)-(17))/(18)"/></font></h:outputLabel>	
    								<h:inputText id="mandat" value="#{CoutobjectifachatBean.coutcible.mandat}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>			
    								<h:outputLabel><font><h:outputText value="kEUR"/></font></h:outputLabel>	
     
    							</h:panelGrid>	
    							<!-- Fin petit panel -->
     
    							<h:message style="color: red; text-decoration: none;margin-left:100px;" id="registerError" for="cBValider"/><br />
     
    						</rich:panel>
     
    							<h:panelGroup style="position:relative;bottom:300px;margin-left:160px;">
    								<h:commandButton id="cBValider" action="#{CoutobjectifachatBean.valider}"  value="OK" title="Cliquez ici pour insérer un cout cible dans la base"  /><rich:spacer width="10px" />
    								<a4j:commandButton action="#{CoutobjectifachatBean.annuler}" value="Annuler" reRender="BesoinForm"/>			
    							</h:panelGroup>
     
    					</h:form>
     
    		  		</div>
    		    </div>
     
        <div id="footer">
          <hr />
     
        </div>
     
    </f:view>
    </body>
    </html>

    Merci d'avance de votre aide.

  2. #2
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    pourrais-tu être plus précis? La librairie que tu pointe n'est pas une librairie JSF, hors ton code utilise du JSF.

  3. #3
    Membre expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2007
    Messages
    2 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2007
    Messages : 2 938
    Points : 3 938
    Points
    3 938
    Par défaut
    Qu'est ce qui marche pas? faut toujours spécifier l'erreur qui apparait.
    Vous avez peut être hâte de réussir et il n'y a rien de mal à cela...
    mais la patience est aussi une vertu; l'échec vous l'enseignera certainement..."

  4. #4
    Membre à l'essai
    Inscrit en
    Juillet 2010
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Juillet 2010
    Messages : 74
    Points : 15
    Points
    15
    Par défaut
    Je sais Tchize, mais je ne sais pas comment faire et mes recherches mon orienté vers ce lien.

  5. #5
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    le plus simple si tu utilise du JSF:

    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <h:inputText value="...." >
     <f:validateLongRange/> <!-- seulement des entiers -->
    </h:inputText>

  6. #6
    Membre à l'essai
    Inscrit en
    Juillet 2010
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Juillet 2010
    Messages : 74
    Points : 15
    Points
    15
    Par défaut
    Tchize je peux toujours ecrire des lettres, je suis désolé mais ton code ne marche pas.

  7. #7
    Membre expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2007
    Messages
    2 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2007
    Messages : 2 938
    Points : 3 938
    Points
    3 938
    Par défaut
    Si tu ne trouves pas de comportement automatique tu peux tjrs faire du javascript à la place. je vois bien une fonction javascript qui est appelée à chaque fois qu'on saisit dans le champ, cette fonction récupère le dernier caractère et fais un parseInt , si échec alors elle efface ce dernier caractère saisi. ceci marchera bien. t'as l'evenement onKeyPress ou onChange, cate dit d'essayer?
    Vous avez peut être hâte de réussir et il n'y a rien de mal à cela...
    mais la patience est aussi une vertu; l'échec vous l'enseignera certainement..."

  8. #8
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    oui tu peux toujours les écrire, mais tu ne pourra pas les sauver, le page jsf se réaffichera avec un message d'erreur quand tu enverra le formulaire, c'est le principe de la validation...

  9. #9
    Membre à l'essai
    Inscrit en
    Juillet 2010
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Juillet 2010
    Messages : 74
    Points : 15
    Points
    15
    Par défaut
    Merci Tchize, mais n'y aurait il pas un moyen d'empêcher carrément la saisie de lettres, ou d'autorisé que la saisie de chiffre.

  10. #10
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    peut etre en javascript, mais ça ne concerne plus java.

  11. #11
    Membre expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2007
    Messages
    2 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2007
    Messages : 2 938
    Points : 3 938
    Points
    3 938
    Par défaut
    Je viens de tester cette fonction toute faite pour toi :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    function forbitTextChar()
    {
    	field = document.getElementById("ton_champ");
    	value = field.value;
    	if (value.length !=0 && isNaN(value.substring(value.length-1)))
    	{
    			field.value = value.substring(0, value.length - 1);
    	}
    }
    Tu l'appelles en collant un evenement
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    onkeyup="forbitTextChar()"
    et tu verras la magie du code
    Vous avez peut être hâte de réussir et il n'y a rien de mal à cela...
    mais la patience est aussi une vertu; l'échec vous l'enseignera certainement..."

  12. #12
    Membre à l'essai
    Inscrit en
    Juillet 2010
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Juillet 2010
    Messages : 74
    Points : 15
    Points
    15
    Par défaut
    Merci DevServlet,

    Je voudrai juste une précision la fonction :

    function forbitTextChar()
    {
    field = document.getElementById("ton_champ");
    value = field.value;
    if (value.length !=0 && isNaN(value.substring(value.length-1)))
    {
    field.value = value.substring(0, value.length - 1);
    }
    }

    je l'a met où exactement.

    En tout cas merci de tes recherches.

  13. #13
    Membre expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2007
    Messages
    2 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2007
    Messages : 2 938
    Points : 3 938
    Points
    3 938
    Par défaut
    T'as pas de javascript dans ton projet? peux tu nous montrer le code de la page en indiquant le champ que tu veux proteger en saisie?
    Vous avez peut être hâte de réussir et il n'y a rien de mal à cela...
    mais la patience est aussi une vertu; l'échec vous l'enseignera certainement..."

  14. #14
    Membre à l'essai
    Inscrit en
    Juillet 2010
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Juillet 2010
    Messages : 74
    Points : 15
    Points
    15
    Par défaut
    Bien sûr

    Code 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
    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
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
     
    <!-- Import nécessaire -->
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
     
    <%@ taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
    <%@ taglib prefix="rich" uri="http://richfaces.org/rich" %>
    <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
    <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
     
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
     
     
    <%@page import="CSCI_SB.CSC_GDB.CSC_CONSULTATION.CoutobjectifachatBean"%>
     
     
    <html>
     
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <meta http-equiv="Content-Style-Type" content="text/css" />
        <link rel="stylesheet" type="text/css" href="css.css" />
     
        <!-- Titre en haut de la page -->
    	<title>THOT : Mandat</title>
     
    <script language="Javascript1.2" type="text/javascript">
     
    function Chargement() {
     
    }
     
    </script>
     
     
     
     
     
     
     
    </head>
    <body onLoad="Chargement();">
     
    <f:view>
     
    <!-- L'en-tête -->
        <div id="logoThales" ></div>
        <div id="entete">
        	<strong class="important">TH</strong>alès <strong class="important">O</strong>util de sous-<strong class="important">T</strong>raitance <img src="img/thot.jpg" style="position:absolute;top:5px;left:1050px;" width=35 height=7%>
        </div>
     
         <!-- Partie connexion avec la date -->
        <div id="connexion">
        <h:form>
           <strong><h:outputText value="#{connexionBean.utilisateur.nom}" /><rich:spacer width="5" /><h:outputText value="#{connexionBean.utilisateur.prenom}" /> | <h:outputLink value="modifierCompte.jsf"><h:outputText value="Compte" /></h:outputLink> | <h:commandLink action="#{connexionBean.deconnexion}" immediate="true" value="Déconnexion" />| <script type="text/javascript" src="date.js"></script></strong>
    	</h:form>
        </div>
     
         <!-- Les menus -->
        <div id="menu">
        	<f:subview id="menuSub">
     
    			<%@ include file="menu.jsp" %>
    		</f:subview>
        </div>
     
        <!-- Le corps -->
     
     
     
    	    <div id="action"></div>
    		    <div id="corps">
     
    				<div id="coutobjectifachat">
     
    					<!-- Titre de la page -->
    					<h2>Détermination du mandat</h2> 
    					<center>(Cout cible pour une sous-traitance de développement) </center> 				 
     
    					<!-- Espace de 30px entre le titre et le formulaire -->
    					<rich:spacer height="30px" />					 
     
    					<h:form id="BesoinForm" style="width: 100%;" >
     
     
     
    						<h:panelGrid columns="6" >						
    							<h:outputLabel><font><h:outputText value="Affaire : "/></font></h:outputLabel>
     
     
    						<!-- Choisir une affaire dans la liste déroulante -->
    					<h:selectOneMenu id="affaire" value="#{CoutobjectifachatBean.idAffaire}" >
    						<f:selectItems value="#{CoutobjectifachatBean.listAffaire}" />
    						<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.affaireByID}" reRender="projet" />
    					</h:selectOneMenu>
     
     
    					<h:outputLabel><font><h:outputText value="Sous-ensemble : "/></font></h:outputLabel>
     
    					<h:selectOneMenu id="projet" value="#{CoutobjectifachatBean.idProjet}"  >
    						<f:selectItem itemValue="0" itemLabel="Choisir un projet"/>
    						<f:selectItems  value="#{CoutobjectifachatBean.listProjettrie}"/>	
    						<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.projetByID}" reRender="besoinSelectMenu" />					
    					</h:selectOneMenu>		
     
    					<h:outputLabel><font><h:outputText value="Selection du Besoin : "/></font></h:outputLabel>
    					<h:selectOneMenu id="besoinSelectMenu" value="#{CoutobjectifachatBean.id}" converter="javax.faces.Integer">
    						<f:selectItems value="#{CoutobjectifachatBean.listBesointrie}" />
    						<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.besoinByID}" reRender="worknomcharge,chargetransverse,risqueslitigesmontant,opprotunitesmontant,chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseur,suivifournisseureuros,suivifournisseurjours,tjmtas,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coef,coefk" />
    					</h:selectOneMenu>
    					<h:message showDetail="true" style="color: red; text-decoration: none;" id="messageBesoin" for="besoinSelectMenu" />
     
    						</h:panelGrid>	
     
    						<rich:spacer height="20px" /> 
     
    						<rich:panel header="" style="width:980px;">	
     
    							<h:outputLabel><font><center><h:outputText value="Montant chargé provisionné pour le développement par TAS :" style="color:orange;font-size:15px"/></center></font></h:outputLabel>
    							<br/>
    							<br/>							
    							<h:outputLabel><font><u><h:outputText value="MAKE : Si les travaux sont fait pour TSA" /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<!-- Petit panel de 3 colonnes où dans chaque colonne est placé un composant -->
    							<h:panelGrid columns="7" >	
    								<h:outputLabel><font><h:outputText value="WorkLoad non chargé (Implémentation, Soutien, Conception, Qualification) " /></font><font><h:outputText style="color:red" value="(1) :"/></font></h:outputLabel>							
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>		
    								<h:inputText id="worknomcharge"  value="#{CoutobjectifachatBean.coutcible.worknomcharge}" title= "Charge transverse jours = Worknomcharge * Charge transverse" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>	<!-- Exemple de champs de siaise que je veux protéger-->								
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />
     
    								<h:outputLabel><font><h:outputText value="j" /></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
     
    								<!-- Petit composant qui ai une échelle de pourcentage pour choisir la charge transverse, la value de inputNumberSlider sera à modifier -->
    								<h:outputLabel><font><h:outputText value="Charge transverse lié au dév (management, qualité, garantie) "/></font><font><h:outputText style="color:red" value="(2) :"/></font></h:outputLabel>	
    								<h:inputText id="chargetransverse" value="#{CoutobjectifachatBean.coutcible.montantcharge}" title= "Charge transverse jours = Worknomcharge * Charge transverse" onkeyup="forbitTextChar()"><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>		<!-- Exemple de champs de siaise que je veux protéger-->					
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />
    								<h:outputLabel><font><h:outputText value="% soit"/></font></h:outputLabel>		
    								<h:inputText id="chargetransversejour"  value="#{CoutobjectifachatBean.coutcible.chargetransversejour}" disabled="true" title= "Charge transverse jours = Worknomcharge * Charge transverse" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>										
    								<h:outputLabel><font><h:outputText value="j " /></font><font><h:outputText style="color:red" value="(4)" title= "Charge transverse jours = Worknomcharge * Charge transverse == (4)=(1)*(2)"/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>		
     
     
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    							    <h:outputLabel><font><h:outputText value="TOTAL :"/></font></h:outputLabel>		
    								<h:inputText id="totaljours"  value="#{CoutobjectifachatBean.coutcible.totaljours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>									
    								<h:outputLabel><font><h:outputText value="j "/></font><font><h:outputText style="color:red" value="(5)" title= "Total jours = Worknomcharge + Charge transverse == (5)=(1)+(2)" /></font></h:outputLabel>
    								<h:inputText id="totalkeur"  value="#{CoutobjectifachatBean.coutcible.totalkeur}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>		
    								<h:outputLabel><font><h:outputText value="EUR "/></font><font><h:outputText style="color:red" value="(6)" title= "Total kEUR = (Worknomcharge + Charge transverse jours)* Tjmeuros == (6)=((1)+(4))*(3)"/></font></h:outputLabel>
     
     
    							</h:panelGrid>	
    							<!-- Fin petit panel -->
    														<!-- Espace de 20px entre le second panel et le troisième-->
    							<rich:spacer height="20" />
     
    							<!-- Petit panel de 4 colonnes où dans chaque colonne est placé un composant -->
    							<h:panelGrid columns="2" >	
     
    								<h:outputLabel><font><h:outputText value="TJM : "/></font></h:outputLabel>
     
    								<!-- Choisir une entite dans la liste déroulante -->
    								<h:selectOneMenu id="tjmtas" value="#{CoutobjectifachatBean.idEntite}" >
    									<f:selectItems value="#{CoutobjectifachatBean.listEntite}" />
    									<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.entiteByID}" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />
    								</h:selectOneMenu>
     
    								<h:outputLabel><font><h:outputText value="TJM en EUR "/></font><font><h:outputText style="color:red" value="(3) :"/></font></h:outputLabel>		
    								<h:inputText id="tjmeuros"  value="#{CoutobjectifachatBean.coutcible.montanttjm}" disabled="true"  />
     
     
    							</h:panelGrid>
    							<!-- Fin petit panel -->
     
     
     
    							<!-- Petite ligne de séparation dans ce composant-->
    							<br/><rich:separator height="2" lineType="solid"/><br/>
     
    							<!-- Petit panel de 7 colonnes où dans chaque colonne est placé un composant -->
     
     
    							<h:panelGrid columns="8" >	
     
    								<!-- Petit composant qui ai une échelle de pourcentage pour choisir la charge transverse, la value de inputNumberSlider sera à modifier -->
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="(+) Risques "/></font></h:outputLabel>	
    								<h:inputText id="risqueslitigesmontant"  value="#{CoutobjectifachatBean.coutcible.risques}"><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>				
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk"/>	
    								<h:outputLabel><font><h:outputText value="% "/></font><font><h:outputText style="color:red" value="(7) "/></font><font><h:outputText value="soit"/></font></h:outputLabel>		
    								<h:inputText id="risqueslitigesjours" value="#{CoutobjectifachatBean.coutcible.risquesjours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>		
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (8) " title= "Risques JOUR = Risques * Total JOUR == (8)=(7)*(5)"/></font></h:outputLabel>	
    								<h:inputText id="risqueslitigesmontanteuros" value="#{CoutobjectifachatBean.coutcible.risqueseuros}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>									
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (9)" title= "Risques kEUR = Risques * Total kEUR == (9)=(7)*(6)"/></font></h:outputLabel>		
     
    								<!-- Petit composant qui ai une échelle de pourcentage pour choisir la charge transverse, la value de inputNumberSlider sera à modifier -->
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="(-) Opportunités "/></font></h:outputLabel>	
    								<h:inputText id="opprotunitesmontant" value="#{CoutobjectifachatBean.coutcible.opportunite}" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>				
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk"/>	
    								<h:outputLabel><font><h:outputText value="% "/></font><font><h:outputText style="color:red" value="(10) "/></font><font><h:outputText value="soit"/></font></h:outputLabel>		
    								<h:inputText id="opprotunitesjours" value="#{CoutobjectifachatBean.coutcible.opportunitejours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>	
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (11) " title= "Opportunites JOUR = Opportunites * Total JOUR == (11)=(7)*(5)"/></font></h:outputLabel>	
    								<h:inputText id="opprotunitesmontanteuros" value="#{CoutobjectifachatBean.coutcible.opportuniteeuros}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>									
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (12)" title= "Opportunites kEUR = Opportunites * Total kEUR == (12)=(10)*(6)"/></font></h:outputLabel>		
     
     
     
     
     
    							<!-- Petite ligne de séparation dans ce composant-->
    								<h:outputLabel><font><h:outputText value="------------------------------------------------"/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="--------------------------------------------------"/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value="--------------------------------"/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value="---------"/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="--------------------------------"/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="-"/></font></h:outputLabel>		
    								<h:outputLabel><font><h:outputText value="--------------------------------"/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="-------"/></font></h:outputLabel>
    							<!-- Petit panel de 3 colonnes où dans chaque colonne est placé un composant -->
     
     
    								<!-- -->
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="MONTANT TOTAL SANS RISQUES"/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:inputText id="montanttotalsansrisquesjours" value="#{CoutobjectifachatBean.coutcible.montanttotalsansrisquesjours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>	
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (5)" title= "Montant total sans risques jours = Worknomcharge + Charge transverse == (5)=(1)+(2)" /></font></h:outputLabel>		
    								<h:inputText id="montanttotalsansrisqueskeur" value="#{CoutobjectifachatBean.coutcible.montanttotalsansrisqueskeur}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>			
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (6)" title= "Montant total sans risques kEUR = (Worknomcharge + Charge transverse jours)* Tjmeuros == (6)=((1)+(4))*(3)"/></font></h:outputLabel>		
     
     
    								<!--  -->
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="MONTANT TOTAL AVEC RISQUES "/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:inputText id="montanttotalavecrisquesjours" value="#{CoutobjectifachatBean.coutcible.montanttotalavecrisquesjours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>	
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (13)" title= "Montant total avec risques jours = Total jours + Risques jours == (13)=(5)+(8)"/></font></h:outputLabel>		
    								<h:inputText id="montanttotalavecrisqueskeur" value="#{CoutobjectifachatBean.coutcible.montanttotalavecrisqueskeur}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>			
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (14)" title= "Montant total avec risques kEUR = Total kEUR + Risques kEUR == (14)=(6)+(9)"/></font></h:outputLabel>		
    							</h:panelGrid>	
     
    						</rich:panel>
    					<rich:panel style="position:relative;bottom:320px;left:-180px;width:160px;border:0">
     
    							<h:outputLabel><font><u><h:outputText value="Aide pour les formules :" /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<h:panelGrid columns="1" >
    							<h:outputLabel><font><h:outputText style="color:red" value="(4)=(1)*(2)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(5)=(1)+(2)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(6)=((1)+(4))*(3)"/></font></h:outputLabel>		
    							</h:panelGrid>	
    					</rich:panel>
    					<rich:panel style="position:relative;bottom:280px;left:-180px;width:160px;border:0">
     
    							<h:outputLabel><font><u><h:outputText value="Aide pour les formules :" /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<h:panelGrid columns="1" >
    							<h:outputLabel><font><h:outputText style="color:red" value="(8)=(7)*(5)"/></font></h:outputLabel>
    							<h:outputLabel><font><h:outputText style="color:red" value="(9)=(7)*(6)"/></font></h:outputLabel>
    							<h:outputLabel><font><h:outputText style="color:red" value="(11)=(7)*(5)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(12)=(10)*(6)"/></font></h:outputLabel>
    							<h:outputLabel><font><h:outputText style="color:red" value="(13)=(5)+(8)-(11)"/></font></h:outputLabel>
    							<h:outputLabel><font><h:outputText style="color:red" value="(14)=(6)+(9)-(12)"/></font></h:outputLabel>	
     
    							</h:panelGrid>	
    					</rich:panel>
    					<rich:panel style="position:relative;bottom:220px;left:-180px;width:160px;border:0">
     
    							<h:outputLabel><font><u><h:outputText value="Aide pour les formules :" /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<h:panelGrid columns="1" >
    							<h:outputLabel><font><h:outputText style="color:red" value="(16)=(17)/(3)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(17)=(15)*(6)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(19)=((14)-(17))/(18)"/></font></h:outputLabel>	
    							</h:panelGrid>	
    					</rich:panel>
     
    					<rich:panel style="position:relative;bottom:330px;left:0px;width:980px;">
     
    							<h:outputLabel><font><u><h:outputText value="BUY : Si les travaux sont  sous traités " /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<!-- Petit panel de 2 colonnes où dans chaque colonne est placé un composant -->
    							<h:panelGrid columns="7" >
     
    								<!-- Petit composant qui ai une échelle de pourcentage pour suivi du fournisseur (FRN), la value de inputNumberSlider sera à modifier -->
    								<h:outputLabel><font><h:outputText value="Part de suivi du FRN par TSA"/></font><font><h:outputText style="color:red" value=" (15) :"/></font></h:outputLabel>	
    								<h:inputText id="suivifournisseur" converter="#{Integer}" required="true" value="#{CoutobjectifachatBean.coutcible.suivifrn}" />								
     
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />														 
    								<h:outputLabel><font><h:outputText value="% soit"/></font></h:outputLabel>					
    								<h:inputText id="suivifournisseurjours" value="#{CoutobjectifachatBean.coutcible.suivifournisseurjours}" disabled="true"  ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>		
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (16)" title= "Suivi FRN jours = Suivi FRN kEUR / Tjmeuros == (16)=(17)/(3)"/></font></h:outputLabel>		
    								<h:inputText id="suivifournisseureuros" value="#{CoutobjectifachatBean.coutcible.suivifournisseureuros}" disabled="true"  ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>				
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (17)" title= "Suivi FRN kEUR = Suivi FRN * Total kEUR == (17)=(15)*(6)"/></font></h:outputLabel>	
     
     
     
     
    								<!-- Petit panel de 4 colonnes où dans chaque colonne est placé un composant -->
    								<h:panelGrid columns="2" >	
     
    									<h:outputLabel><font><h:outputText value="Coef d'appro : "/></font><font><h:outputText style="color:red" value=" (18) :"/></font></h:outputLabel>
     
    									<!-- Choisir une entite dans la liste déroulante -->
    									<h:selectOneMenu id="coef" value="#{CoutobjectifachatBean.idCoefappro}" >
    										<f:selectItems value="#{CoutobjectifachatBean.listCoefappro}" />
    										<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.coefapproByID}" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />
    									</h:selectOneMenu>
     
    									<h:outputLabel><font><h:outputText value="Coef "/></font><font><h:outputText style="color:red" value="(18) :"/></font></h:outputLabel>		
    									<h:inputText id="coefk"  value="#{CoutobjectifachatBean.coutcible.k}" disabled="true"  />
     
     
    								</h:panelGrid>
    								<!-- Fin petit panel -->	
     
     
     
    							</h:panelGrid>	
    							<h:panelGrid columns="3" >	
     
    								<h:outputLabel><font><h:outputText value="PART MAXIMALE (MANDAT)"/></font><font><h:outputText style="color:red" value=" (19) = " title= "MANDAT = (Total kEUR - Suivi FRN kEUR) / Coeff d'appro == (19)=((6)-(17))/(18)"/></font></h:outputLabel>	
    								<h:inputText id="mandat" value="#{CoutobjectifachatBean.coutcible.mandat}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>			
    								<h:outputLabel><font><h:outputText value="kEUR"/></font></h:outputLabel>	
     
    							</h:panelGrid>	
    							<!-- Fin petit panel -->
     
    							<h:message style="color: red; text-decoration: none;margin-left:100px;" id="registerError" for="cBValider"/><br />
     
    						</rich:panel>
     
    							<h:panelGroup style="position:relative;bottom:300px;margin-left:160px;">
    								<h:commandButton id="cBValider" action="#{CoutobjectifachatBean.valider}"  value="OK" title="Cliquez ici pour insérer un cout cible dans la base"  /><rich:spacer width="10px" />
    								<a4j:commandButton action="#{CoutobjectifachatBean.annuler}" value="Annuler" reRender="BesoinForm"/>			
    							</h:panelGroup>
     
    					</h:form>
     
    		  		</div>
    		    </div>
     
        <div id="footer">
          <hr />
     
        </div>
     
    </f:view>
    </body>
    </html>
    Code de traitement

    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
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    package CSCI_SB.CSC_GDB.CSC_CONSULTATION;
     
     
    import java.util.ArrayList;
    import java.util.Calendar;
    import java.util.Iterator;
    import java.util.List;
     
    import javax.faces.application.FacesMessage;
    import javax.faces.context.FacesContext;
    import javax.faces.event.ActionEvent;
    import javax.faces.model.SelectItem;
     
    import util.PagePrecedenteBean;
    import util.connexion.ConnexionBean;
    import CSCI_TRANSVERSAL.CSC_HIBERNATE.Affaire;
    import CSCI_TRANSVERSAL.CSC_HIBERNATE.Besoin;
    import CSCI_TRANSVERSAL.CSC_HIBERNATE.Coefappro;
    import CSCI_TRANSVERSAL.CSC_HIBERNATE.Coutcible;
    import CSCI_TRANSVERSAL.CSC_HIBERNATE.Entite;
    import CSCI_TRANSVERSAL.CSC_HIBERNATE.Projet;
    import CSCI_TRANSVERSAL.CSC_HIBERNATE.Utilisateur;
    import CSCI_TRANSVERSAL.CSC_HIBERNATE.DAO.AffaireDAO;
    import CSCI_TRANSVERSAL.CSC_HIBERNATE.DAO.BesoinDAO;
    import CSCI_TRANSVERSAL.CSC_HIBERNATE.DAO.CoefapproDAO;
    import CSCI_TRANSVERSAL.CSC_HIBERNATE.DAO.CoutcibleDAO;
    import CSCI_TRANSVERSAL.CSC_HIBERNATE.DAO.EntiteDAO;
    import CSCI_TRANSVERSAL.CSC_HIBERNATE.DAO.ProjetDAO;
     
     
     
    public class CoutobjectifachatBean {
     
    	Affaire uneAffaire = new Affaire();
    	Besoin unBesoin = new Besoin();
    	Projet projet = new Projet();
    	Entite uneEntite= new Entite();
    	Coutcible coutcible = new Coutcible();
    	Coefappro unCoefappro = new Coefappro();
    	int selectionAffaireId;
    	int selectionProjetId;
    	int selectionEntiteId;
    	int selectionCoefapproId;
    	int selectionBesoinId;
     
     
     
     
     
     
    	/*********************************  DEBUT FONCTIONS AFFAIRE   ****************************************************/
     
    	/**
    	 * getter de selectionAffaireId
    	 * @return l'indice de la selectOneMenu
    	 */
    	public int getIdAffaire()
    	{
    		return selectionAffaireId;
    	}
     
    	/**
    	 * setter de selectionAffaireId
    	 * @param id
    	 */
    	public void setIdAffaire(int id)
    	{
    		selectionAffaireId = id;
    	}
     
     
     
    	/**
    	 * charge les donnée en fonction de l'affaire Selectionnée
    	 * @param event
    	 */
    	public void affaireByID(ActionEvent event)
    	{
    		Affaire affaireRecup = AffaireDAO.findById(selectionAffaireId);
    			if(affaireRecup!=null && affaireRecup.getId()!=null){
    				uneAffaire = affaireRecup;
    			}
    			else
    				uneAffaire = new Affaire();
    	}
     
     
    	/********************************************************************************************************
    	 * Retourne l'id de l'affaire s'il existe
    	 * sinon retourne 0
    	 * @return id affaire
    	 *******************************************************************************************************/
    	public int getAffaire() {
    		if (projet.getAffaire() == null)
    			return 0;
    		else
    			return projet.getAffaire().getId();
    	}
     
     
     
    	/********************************************************************************************************
    	 * Edite l'affaire du projet grace à son id
    	 * @param IdProduit id du affaire
    	 *******************************************************************************************************/
    	public void setAffaire(int IdAffaire) {
    		if (IdAffaire != 0)
    			projet.setAffaire(AffaireDAO.findById(IdAffaire));
    	}
     
     
    	/************************************************************************************************************
    	 * return la liste des Affaires présente dans la base
    	 * @return List<SelectItem> Affaire
    	 ***********************************************************************************************************/
    	public List<SelectItem> getListAffaire(){
     
    		ArrayList<SelectItem> listAffaire= new ArrayList<SelectItem>();
    		listAffaire.add(new SelectItem(0,"Choisir une Affaire"));
    		try{
    			Iterator<Affaire> it = AffaireDAO.findAll().iterator();
    			while (it.hasNext()){
    				Affaire uneAffaire = it.next();
    				listAffaire.add(new SelectItem(uneAffaire.getId(),uneAffaire.getNomaffaire()));
    			}
    		}catch(Exception e){}
     
    		return listAffaire;
    	}
     
    	/*********************************  FIN FONCTIONS AFFAIRE   ****************************************************/
     
     
     
     
     
     
     
     
    	/*********************************  DEBUT FONCTIONS PROJET   ****************************************************/
     
    	/**
    	 * getter de selectionProjetId
    	 * @return l'indice de la selectOneMenu
    	 */
    	public int getIdProjet()
    	{
    		return selectionProjetId;
    	}
     
    	/**
    	 * setter de selectionProjetId
    	 * @param id
    	 */
    	public void setIdProjet(int id)
    	{
    		selectionProjetId = id;
    	}
     
     
    	/**
    	 * charge les donnée en fonction du projet Selectionné
    	 * @param event
    	 */
    	public void projetByID(ActionEvent event)
    	{
    			Besoin besoinRecup = BesoinDAO.findById(selectionBesoinId);
    			if(besoinRecup!=null && besoinRecup.getId()!=null){
    				unBesoin = besoinRecup;
    			}
    			else
    				unBesoin = new Besoin();
     
     
    	}
     
     
    	/************************************************************************************************************
    	 * retourne l'id du projet correspondant au besoin
    	 * 
    	 ***********************************************************************************************************/
    	public int getProjet()
    	{
    		if(unBesoin.getProjet()!=null)
    			return unBesoin.getProjet().getId();
    		return 0;
    	}
     
     
     
    	/************************************************************************************************************
    	 * ajoute le projet au besoin
    	 * @param numProjet représente id de le projet selectionner
    	 ***********************************************************************************************************/
    	public void setProjet(int numProjet)
    	{
    		this.unBesoin.setProjet(ProjetDAO.findById(numProjet));
    	}
     
    	/************************************************************************************************************
    	 * return la liste des Projet présente dans la base
    	 * @return List<SelectItem> Projet
    	 ***********************************************************************************************************/
    	public List<SelectItem> getListProjet(){
    		ArrayList<SelectItem> listProjet= new ArrayList<SelectItem>();
    		listProjet.add(new SelectItem(0,"Choisir un Projet"));
    		try{
    			Iterator<Projet> it = ProjetDAO.findAll().iterator();
    			while (it.hasNext()){
    				Projet unProjet = it.next();
    				listProjet.add(new SelectItem(unProjet.getId(),unProjet.getNomprojet()));
    			}
    		}catch(Exception e){}
     
    		return listProjet;
    	}
     
     
    	/**
    	 * retourne la liste des Projets de l'affaire sélectionné
    	 * @return
    	 */
    	public List<SelectItem> getListProjettrie(){
    		Affaire uneAffaire= new Affaire();
    		ArrayList<SelectItem> listProjet= new ArrayList<SelectItem>();
    		try{
    			uneAffaire.setId(selectionAffaireId);
    			System.out.println(uneAffaire.getId());
    			Iterator<Projet> it = ProjetDAO.findByAffaire(uneAffaire).iterator();
    			while (it.hasNext()){
    				Projet unProjet = it.next();
    				listProjet.add(new SelectItem(unProjet.getId(),unProjet.getNomprojet()));
    			}
    		}
    		catch(Exception e){}
    		return listProjet;
    	}
     
    	/*********************************  FIN FONCTIONS PROJET   ****************************************************/
     
     
     
     
     
     
     
     
     
    	/*********************************  DEBUT FONCTIONS BESOIN   ****************************************************/
     
    	/**
    	 * getter de selectionBesoinId
    	 * @return l'indice de la selectOneMenu
    	 */
    	public int getId()
    	{
    		return selectionBesoinId;
    	}
     
    	/**
    	 * setter de selectionBesoinId
    	 * @param id
    	 */
    	public void setId(int id)
    	{
    		selectionBesoinId = id;
    	}
     
    	/**
    	 * charge les donnée en fonction du besoin Selectionné
    	 * @param event
    	 */
    	public void besoinByID(ActionEvent event)
    	{
     
     
     
    			Besoin besoinRecup = BesoinDAO.findById(selectionBesoinId);
     
     
    		/*	Coutcible coutcibleRecup = (Coutcible) CoutcibleDAO.findByBesoin(besoinRecup);
    			System.out.println("bhhhhhhhhhhhhhhhhhhhhhhhhh");
    			coutcible.setNomentite(coutcibleRecup.getNomentite()); 
    			System.out.println("chhhhhhhhhhhhhhhhhhhhhhhhh");
    			if(besoinRecup!=null && besoinRecup.getId()!=null){
    				System.out.println("ahhhhhhhhhhhhhhhhhhhhhhhhh");
    				unBesoin = besoinRecup;
    			}
    			else
    				unBesoin = new Besoin();
    			if(coutcibleRecup!=null && coutcibleRecup.getId()!=null){
    				System.out.println("ahhhhhhhhhhhhhhhhhhhhhhhhh");
    				coutcible = coutcibleRecup;
     
    			}
    			else
    				coutcible = new Coutcible();*/
     
     
     
    			//coutcible.setNomentite(coutcibleRecup.getNomentite()); 
     
    			if(besoinRecup!=null && besoinRecup.getId()!=null){
    				//System.out.println("besoinRecup"+besoinRecup.getId());
    				unBesoin = besoinRecup;
    			}
    			else
    				unBesoin = new Besoin();
     
    			try{
     
    				System.out.println("besoinRecup"+unBesoin.getId());
     
    				//Normalement c'est cette ligne qui ne fonctionne pas tout le temps et qui provoque l'erreur
    				//Iterator<Coutcible> it = CoutcibleDAO.findAll().iterator();
     
    				Iterator<Coutcible> it = CoutcibleDAO.findByBesoin(unBesoin).iterator();
     
    				System.out.println("besoinRecuph"+unBesoin.getId());
     
    				while (it.hasNext()){
    					Coutcible unCoutcible = it.next();
    					if((unCoutcible.getBesoin().getId())== unBesoin.getId()&& unCoutcible.getId()!=null)
    					{	
    					coutcible.setWorknomcharge(unCoutcible.getWorknomcharge());
    					coutcible.setRisques(unCoutcible.getRisques());
    					coutcible.setOpportunite(unCoutcible.getOpportunite());
    					coutcible.setMontantcharge(unCoutcible.getMontantcharge());
    					coutcible.setMandat(unCoutcible.getMandat());
    					coutcible.setSuivifrn(unCoutcible.getSuivifrn());
    					coutcible.setNomentite(unCoutcible.getNomentite());
    					coutcible.setMontanttjm(unCoutcible.getMontanttjm());
    					coutcible.setCode(unCoutcible.getCode());
    					coutcible.setK(unCoutcible.getK());
    					}
    					else
    						coutcible = new Coutcible();
    				}
     
     
     
     
     
    				/*while (it3.hasNext()){
    					Coutcible coutcibleRecup = it3.next();
    					if((coutcibleRecup.getBesoin().getId())== unBesoin.getId() && coutcibleRecup.getId()!=null){
    						System.out.println("bhhhhhhhhhhhhhhhhhhhhhhhhh");
    						coutcible = coutcibleRecup;
    					}
    				}
     
     
    				while (it.hasNext()){
    					Coutcible coutcibleRecup = it.next();
    					//Coutcible coutcibleRecup = (Coutcible) CoutcibleDAO.findByBesoin(besoinRecup);
     
     
    					if(coutcibleRecup!=null && coutcibleRecup.getId()!=null){
    						System.out.println("chhhhhhhhhhhhhhhhhhhhhhhhh");
    						System.out.println("MONTANTCHARGE"+coutcibleRecup.getMontantcharge());
    						coutcible = coutcibleRecup;
     
    					}
    					else
    						coutcible = new Coutcible();
    				}*/
     
    			}
    			catch(Exception e){}	
     
     
    	}
     
     
     
    	/**
    	 * getter de besoin
    	 * @return unBesoin
    	 */
    	public Besoin getBesoin()
    	{
    		return unBesoin;
    	}
     
    	/**
    	 * setter de Besoin
    	 * @param unBesoin
    	 */
    	public void setBesoin(Besoin unBesoin)
    	{
    		this.unBesoin = unBesoin;
    	}
     
     
    	/**
    	 * retourne la liste des Besoins de l'utilisateur connecté
    	 * @return
    	 */
    	public List<SelectItem> getListBesointrie(){
    		Projet unProjet= new Projet();
    		ArrayList<SelectItem> listBesoin= new ArrayList<SelectItem>();
    		listBesoin.add(new SelectItem(0,"Choisir un Besoin"));
    		try{
    			unProjet.setId(selectionProjetId);
    			System.out.println(unProjet.getId());
    			Iterator<Besoin> it = BesoinDAO.findByProjet(unProjet).iterator();
    			while (it.hasNext()){
    				Besoin unBesoin = it.next();
    				listBesoin.add(new SelectItem(unBesoin.getId(),unBesoin.getLibelle()));
    			}
    		}
    		catch(Exception e){}
     
    		return listBesoin;
    	}
     
     
    	/**
    	 * retourne la liste des Besoins de l'utilisateur connecté
    	 * @return
    	 */
    	public List<SelectItem> getListBesoin(){
    		Utilisateur unUser= new Utilisateur();
    		ArrayList<SelectItem> listBesoin= new ArrayList<SelectItem>();
     
    		try{
    			ConnexionBean userInfo = (ConnexionBean) FacesContext.getCurrentInstance().getExternalContext()
    									.getSessionMap().get("connexionBean");
    			unUser = userInfo.getUtilisateur();
    			Iterator<Besoin> it = BesoinDAO.findByUser(unUser).iterator();
    			while (it.hasNext()){
    				Besoin unBesoin = it.next();
    				listBesoin.add(new SelectItem(unBesoin.getId(),unBesoin.getLibelle()));
    			}
    		}
    		catch(Exception e){}
    		return listBesoin;
    	}
     
    	/*********************************  FIN FONCTIONS BESOIN   ****************************************************/
     
     
     
     
     
     
     
     
    	/*********************************  DEBUT FONCTIONS ENTITE   ****************************************************/
     
    	/**
    	 * getter de selectionEntiteId
    	 * @return l'indice de la selectOneMenu
    	 */
    	public int getIdEntite()
    	{
     
    		return selectionEntiteId;
    	}
     
    	/**
    	 * setter de selectionProjetId
    	 * @param id
    	 */
    	public void setIdEntite(int id)
    	{
    		selectionEntiteId = id;
    	}
     
     
    	/**
    	 * charge les donnée en fonction de l'entite Selectionnée
    	 * @param event
    	 */
    	public void entiteByID(ActionEvent event)
    	{
     
    		Entite entiteRecup = EntiteDAO.findById(selectionEntiteId);
     
    			if(entiteRecup!=null && entiteRecup.getId()!=null){
    				uneEntite = entiteRecup;
    				tjmeuros(uneEntite);
     
    				coutcible.setNomentite(uneEntite.getNomentite());
    			}
    			else
    				uneEntite = new Entite();
    	}
     
     
     
    	/********************************************************************************************************
    	 * Retourne l'id de l'entite s'elle existe
    	 * sinon retourne 0
    	 * @return id entite
    	 *******************************************************************************************************/
    	public int getEntite() {
    		if (uneEntite.getBesoin() == null)
    			return 0;
    		else
    			return uneEntite.getBesoin().getId();
    	}
     
     
     
    	/********************************************************************************************************
    	 * Edite l'affaire du projet grace à son id
    	 * @param IdProduit id du affaire
    	 *******************************************************************************************************/
    	public void setEntite(int IdBesoin) {
    		if (IdBesoin != 0)
    			uneEntite.setBesoin(BesoinDAO.findById(IdBesoin));
    	}
     
     
    	/************************************************************************************************************
    	 * return la liste des Entites présente dans la base
    	 * @return List<SelectItem> Entite
    	 ***********************************************************************************************************/
    	public List<SelectItem> getListEntite(){
    		ArrayList<SelectItem> listEntite= new ArrayList<SelectItem>();
    		listEntite.add(new SelectItem(0,"Choisir une Entite"));
    		try{
    			Iterator<Entite> it = EntiteDAO.findAll().iterator();
    			while (it.hasNext()){
    				Entite uneEntite = it.next();
    					if(uneEntite.getAnnee()== Calendar.getInstance().get(Calendar.YEAR))
    						listEntite.add(new SelectItem(uneEntite.getId(),uneEntite.getNomentite()));
     
     
    			}
    		}catch(Exception e){}
     
    		return listEntite;
    	}
     
     
    	/**
    	 * retourne le montant du TJM de l'entité sélectionné
    	 * @return
    	 */
    	public void tjmeuros(Entite uneEntite){
     
    		int montanttjm= 0;
    		try{
    			uneEntite.setId(selectionEntiteId);
    			System.out.println(" Entite id : "+uneEntite.getId());
    			montanttjm = uneEntite.getMontanttjm();			
    		}
    		catch(Exception e){}
    		System.out.println("Montanttjm:" + montanttjm);
    		coutcible.setMontanttjm(montanttjm);
    	}
     
    	/*********************************  FIN FONCTIONS ENTITE   ****************************************************/
     
     
     
     
     
     
    	/*********************************  DEBUT FONCTIONS COEF   ****************************************************/
     
    	/**
    	 * getter de selectionCoefapproId
    	 * @return l'indice de la selectOneMenu
    	 */
    	public int getIdCoefappro()
    	{
    		return selectionCoefapproId;
    	}
     
    	/**
    	 * setter de selectionProjetId
    	 * @param id
    	 */
    	public void setIdCoefappro(int id)
    	{
    		selectionCoefapproId = id;
    	}
     
     
    	/**
    	 * charge les donnée en fonction de l'entite Selectionnée
    	 * @param event
    	 */
    	public void coefapproByID(ActionEvent event)
    	{
     
    		Coefappro coefapproRecup = CoefapproDAO.findById(selectionCoefapproId);
     
    			if(coefapproRecup!=null && coefapproRecup.getId()!=null){
    				unCoefappro = coefapproRecup;
    				coefk(unCoefappro);
    				coutcible.setCode(unCoefappro.getCode());
    			}
    			else
    				unCoefappro = new Coefappro();
    	}
     
     
    	/********************************************************************************************************
    	 * Retourne l'id de l'entite s'elle existe
    	 * sinon retourne 0
    	 * @return id entite
    	 *******************************************************************************************************/
    	public int getCoefappro() {
    		if (unCoefappro.getBesoin() == null)
    			return 0;
    		else
    			return unCoefappro.getBesoin().getId();
    	}
     
     
     
    	/********************************************************************************************************
    	 * Edite l'affaire du projet grace à son id
    	 * @param IdProduit id du affaire
    	 *******************************************************************************************************/
    	public void setCoefappro(int IdBesoin) {
    		if (IdBesoin != 0)
    			unCoefappro.setBesoin(BesoinDAO.findById(IdBesoin));
    	}
     
     
    	/************************************************************************************************************
    	 * return la liste des Entites présente dans la base
    	 * @return List<SelectItem> Entite
    	 ***********************************************************************************************************/
    	public List<SelectItem> getListCoefappro(){
    		ArrayList<SelectItem> listCoefappro= new ArrayList<SelectItem>();
    		listCoefappro.add(new SelectItem(0,"Choisir un Coef"));
    		try{
    			Iterator<Coefappro> it = CoefapproDAO.findAll().iterator();
    			while (it.hasNext()){
    				Coefappro unCoefappro = it.next();
    					if(unCoefappro.getAnneecoefappro()== Calendar.getInstance().get(Calendar.YEAR))
    						listCoefappro.add(new SelectItem(unCoefappro.getId(),unCoefappro.getCode()));
    			}
    		}catch(Exception e){}
     
    		return listCoefappro;
    	}
     
     
    	/**
    	 * retourne le coef du coef sélectionné
    	 * @return
    	 */
    	public void coefk(Coefappro unCoeafappro){
     
    		double k= 0.0;
    		try{
    			unCoeafappro.setId(selectionCoefapproId);
    			System.out.println(" Coefappro id : "+unCoeafappro.getId());
    			k = unCoeafappro.getK();			
    		}
    		catch(Exception e){}
    		System.out.println("k:" + k);
    		coutcible.setK(k);
    	}
     
    	/*********************************  FIN FONCTIONS COEF   ****************************************************/
     
     
     
     
     
     
     
     
    	/************************************************************************************************************
    	 * retourne le numero du coutcible relatif au besoin
    	 ***********************************************************************************************************/
    	/*public int getcoutcible()
    	{
    		if(unBesoin.getCoutcible()!=null)
    			return unBesoin.getCoutcible().getId();
    		return 0;
    	}
     
     
     
    	/************************************************************************************************************
    	 *  ajoute le coutcible au besoin grace à son id
    	 * @param numCoutcible
    	 ***********************************************************************************************************/
    	/*public void setcoutcible(int numCoutcible)
    	{		
    			this.unBesoin.setCoutcible(CoutcibleDAO.findById(numCoutcible));
    	}*/
     
     
     
    	/*********************************  DEBUT FONCTIONS COUT CIBLE   ****************************************************/
    	/**
    	 * getter de coutcible
    	 * @return Coutcible
    	 */
    	public Coutcible getCoutcible(){
    		return coutcible;
    	}
     
    	/**
    	 * setter de coutcible
    	 * @param coutcible
    	 */
    	public void setCoutcible(Coutcible coutcible){
    		this.coutcible = coutcible;
    	}
     
    	/*********************************  FIN FONCTIONS COUT CIBLE   ****************************************************/
     
     
     
     
     
     
     
    	/******************************************************************************************************
    	 * permet de valider les information saisi et d'insérer le nouveau cout cible saisi
    	 * @return retourne valider ou error
    	 ********************************************************************************************************/
    	public String valider()
    	{
     
    		FacesContext context = FacesContext.getCurrentInstance();
    		try {
    			//Appel la fonction d'insertion d'un coutcible
    			unBesoin.setId(selectionBesoinId);
    			System.out.println("passe coutcible");
    			coutcible.setBesoin(unBesoin);
    			CoutcibleDAO.attachDirty(coutcible);
    		}catch(org.hibernate.NonUniqueObjectException re)
    		{
    			FacesMessage message = new FacesMessage();
    			message.setSeverity(FacesMessage.SEVERITY_ERROR);
    			message.setSummary("Le coutcible " + coutcible.getId() + " existe déjà");
    			message.setDetail("Le coutcible " + coutcible.getId() + " existe déjà");
    			context.addMessage("creerModifierForm:cBValider", message);
    		}
    		FacesMessage message = new FacesMessage();
    		message.setSeverity(FacesMessage.SEVERITY_INFO);
    		message.setSummary("Coutcible inséré avec succès");
    		message.setDetail("Coutcible inséré avec succès");
    		context.addMessage("BesoinForm:cBValider", message);
    		this.annuler();
    		return "valider";
     
    	}
     
     
     
     
    	/*******************************************************************************************************
    	*                   Annule les valeurs saisies                                                        
    	/********************************************************************************************************/
    	public void annuler()
    	{
    		coutcible = new Coutcible();
    		setIdAffaire(0);
    		setIdProjet(0);
    		setId(0);
    		setIdEntite(0);
    		setIdCoefappro(0);
    		selectionAffaireId=0;
    		selectionProjetId=0;
    		selectionEntiteId=0;
    		selectionCoefapproId=0;
    		coutcible.setWorknomcharge(0.0);	
    		coutcible.setMontantcharge(0.0);
    		coutcible.setRisques(0.0);		
    		coutcible.setOpportunite(0.0);
    		coutcible.setSuivifrn(0.0);
    		coutcible.setMontanttjm(1);
    		coutcible.setK(1.0);
    		coutcible.setMandat(0.0);
     
    	}
    	public void vider()
    	{
     
    		selectionAffaireId=0;
    		selectionProjetId=0;
    		selectionEntiteId=0;
    		selectionCoefapproId=0;
    		coutcible.setWorknomcharge(0.0);	
    		coutcible.setMontantcharge(0.0);
    		coutcible.setRisques(0.0);		
    		coutcible.setOpportunite(0.0);
    		coutcible.setSuivifrn(0.0);
    		coutcible.setMontanttjm(1);
    		coutcible.setK(1.0);
    		coutcible.setMandat(0.0);
     
    	}
     
     
     
     
    	/*********************************************************************************************************
    	 * Fonction permettant le retour à la page precedente
    	 * @return
    	 **********************************************************************************************************/
    	public String retour()
    	{
    		String pageRetour = PagePrecedenteBean.getPagePrecedente();
    		PagePrecedenteBean.retour();
    		return pageRetour;
    	}
     
     
     
     
     
     
    }

  15. #15
    Membre expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2007
    Messages
    2 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2007
    Messages : 2 938
    Points : 3 938
    Points
    3 938
    Par défaut
    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
      <!-- Titre en haut de la page -->
    	<title>THOT : Mandat</title>
     
    <script language="Javascript1.2" type="text/javascript">
     
    function Chargement() {
     
    }
    ...
    function forbitTextChar()
    {
    	field = document.getElementById("ton_id_champ_a_controler");
    	value = field.value;
    	if (value.length !=0 && isNaN(value.substring(value.length-1)))
    	{
    			field.value = value.substring(0, value.length - 1);
    	}
    }
    ...
    Et tu mets ca :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    onkeyup="forbitTextChar()"
    comme attribut au champ que tu veux contrôler
    Vous avez peut être hâte de réussir et il n'y a rien de mal à cela...
    mais la patience est aussi une vertu; l'échec vous l'enseignera certainement..."

  16. #16
    Membre à l'essai
    Inscrit en
    Juillet 2010
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Juillet 2010
    Messages : 74
    Points : 15
    Points
    15
    Par défaut
    code JSP:

    Code xml : 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
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
     
     
    <!-- Import nécessaire -->
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
     
    <%@ taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
    <%@ taglib prefix="rich" uri="http://richfaces.org/rich" %>
    <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
    <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
     
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
     
     
    <%@page import="CSCI_SB.CSC_GDB.CSC_CONSULTATION.CoutobjectifachatBean"%>
     
     
    <html>
     
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <meta http-equiv="Content-Style-Type" content="text/css" />
        <link rel="stylesheet" type="text/css" href="css.css" />
     
        <!-- Titre en haut de la page -->
    	<title>THOT : Mandat</title>
     
    <script language="Javascript1.2" type="text/javascript">
     
    function Chargement() {
     
    }
     
    function forbitTextChar()
    {
    	field = document.getElementById("worknomcharge");
    	value = field.value;
    	if (value.length !=0 && isNaN(value.substring(value.length-1)))
    	{
    			field.value = value.substring(0, value.length - 1);
    	}
    }
    </script>
     
     
     
     
     
     
     
    </head>
    <body onLoad="Chargement();">
     
    <f:view>
     
    <!-- L'en-tête -->
        <div id="logoThales" ></div>
        <div id="entete">
        	<strong class="important">TH</strong>alès <strong class="important">O</strong>util de sous-<strong class="important">T</strong>raitance <img src="img/thot.jpg" style="position:absolute;top:5px;left:1050px;" width=35 height=7%>
        </div>
     
         <!-- Partie connexion avec la date -->
        <div id="connexion">
        <h:form>
           <strong><h:outputText value="#{connexionBean.utilisateur.nom}" /><rich:spacer width="5" /><h:outputText value="#{connexionBean.utilisateur.prenom}" /> | <h:outputLink value="modifierCompte.jsf"><h:outputText value="Compte" /></h:outputLink> | <h:commandLink action="#{connexionBean.deconnexion}" immediate="true" value="Déconnexion" />| <script type="text/javascript" src="date.js"></script></strong>
    	</h:form>
        </div>
     
         <!-- Les menus -->
        <div id="menu">
        	<f:subview id="menuSub">
     
    			<%@ include file="menu.jsp" %>
    		</f:subview>
        </div>
     
        <!-- Le corps -->
     
     
     
    	    <div id="action"></div>
    		    <div id="corps">
     
    				<div id="coutobjectifachat">
     
    					<!-- Titre de la page -->
    					<h2>Détermination du mandat</h2> 
    					<center>(Cout cible pour une sous-traitance de développement) </center> 				 
     
    					<!-- Espace de 30px entre le titre et le formulaire -->
    					<rich:spacer height="30px" />					 
     
    					<h:form id="BesoinForm" style="width: 100%;" >
     
     
     
    						<h:panelGrid columns="6" >						
    							<h:outputLabel><font><h:outputText value="Affaire : "/></font></h:outputLabel>
     
     
    						<!-- Choisir une affaire dans la liste déroulante -->
    					<h:selectOneMenu id="affaire" value="#{CoutobjectifachatBean.idAffaire}" >
    						<f:selectItems value="#{CoutobjectifachatBean.listAffaire}" />
    						<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.affaireByID}" reRender="projet" />
    					</h:selectOneMenu>
     
     
    					<h:outputLabel><font><h:outputText value="Sous-ensemble : "/></font></h:outputLabel>
     
    					<h:selectOneMenu id="projet" value="#{CoutobjectifachatBean.idProjet}"  >
    						<f:selectItem itemValue="0" itemLabel="Choisir un projet"/>
    						<f:selectItems  value="#{CoutobjectifachatBean.listProjettrie}"/>	
    						<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.projetByID}" reRender="besoinSelectMenu" />					
    					</h:selectOneMenu>		
     
    					<h:outputLabel><font><h:outputText value="Selection du Besoin : "/></font></h:outputLabel>
    					<h:selectOneMenu id="besoinSelectMenu" value="#{CoutobjectifachatBean.id}" converter="javax.faces.Integer">
    						<f:selectItems value="#{CoutobjectifachatBean.listBesointrie}" />
    						<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.besoinByID}" reRender="worknomcharge,chargetransverse,risqueslitigesmontant,opprotunitesmontant,chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseur,suivifournisseureuros,suivifournisseurjours,tjmtas,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coef,coefk" />
    					</h:selectOneMenu>
    					<h:message showDetail="true" style="color: red; text-decoration: none;" id="messageBesoin" for="besoinSelectMenu" />
     
    						</h:panelGrid>	
     
    						<rich:spacer height="20px" /> 
     
    						<rich:panel header="" style="width:980px;">	
     
    							<h:outputLabel><font><center><h:outputText value="Montant chargé provisionné pour le développement par TAS :" style="color:orange;font-size:15px"/></center></font></h:outputLabel>
    							<br/>
    							<br/>							
    							<h:outputLabel><font><u><h:outputText value="MAKE : Si les travaux sont fait pour TSA" /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<!-- Petit panel de 3 colonnes où dans chaque colonne est placé un composant -->
    							<h:panelGrid columns="7" >	
    								<h:outputLabel><font><h:outputText value="WorkLoad non chargé (Implémentation, Soutien, Conception, Qualification) " /></font><font><h:outputText style="color:red" value="(1) :"/></font></h:outputLabel>							
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>		
    								<h:inputText id="worknomcharge"  value="#{CoutobjectifachatBean.coutcible.worknomcharge}" title= "Charge transverse jours = Worknomcharge * Charge transverse" onkeyup="forbitTextChar();"><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>									
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />
     
    								<h:outputLabel><font><h:outputText value="j" /></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
     
    								<!-- Petit composant qui ai une échelle de pourcentage pour choisir la charge transverse, la value de inputNumberSlider sera à modifier -->
    								<h:outputLabel><font><h:outputText value="Charge transverse lié au dév (management, qualité, garantie) "/></font><font><h:outputText style="color:red" value="(2) :"/></font></h:outputLabel>	
    								<h:inputText id="chargetransverse" value="#{CoutobjectifachatBean.coutcible.montantcharge}" title= "Charge transverse jours = Worknomcharge * Charge transverse" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>		
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />
    								<h:outputLabel><font><h:outputText value="% soit"/></font></h:outputLabel>		
    								<h:inputText id="chargetransversejour"  value="#{CoutobjectifachatBean.coutcible.chargetransversejour}" disabled="true" title= "Charge transverse jours = Worknomcharge * Charge transverse" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>										
    								<h:outputLabel><font><h:outputText value="j " /></font><font><h:outputText style="color:red" value="(4)" title= "Charge transverse jours = Worknomcharge * Charge transverse == (4)=(1)*(2)"/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>		
     
     
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    							    <h:outputLabel><font><h:outputText value="TOTAL :"/></font></h:outputLabel>		
    								<h:inputText id="totaljours"  value="#{CoutobjectifachatBean.coutcible.totaljours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>									
    								<h:outputLabel><font><h:outputText value="j "/></font><font><h:outputText style="color:red" value="(5)" title= "Total jours = Worknomcharge + Charge transverse == (5)=(1)+(2)" /></font></h:outputLabel>
    								<h:inputText id="totalkeur"  value="#{CoutobjectifachatBean.coutcible.totalkeur}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>		
    								<h:outputLabel><font><h:outputText value="EUR "/></font><font><h:outputText style="color:red" value="(6)" title= "Total kEUR = (Worknomcharge + Charge transverse jours)* Tjmeuros == (6)=((1)+(4))*(3)"/></font></h:outputLabel>
     
     
    							</h:panelGrid>	
    							<!-- Fin petit panel -->
    														<!-- Espace de 20px entre le second panel et le troisième-->
    							<rich:spacer height="20" />
     
    							<!-- Petit panel de 4 colonnes où dans chaque colonne est placé un composant -->
    							<h:panelGrid columns="2" >	
     
    								<h:outputLabel><font><h:outputText value="TJM : "/></font></h:outputLabel>
     
    								<!-- Choisir une entite dans la liste déroulante -->
    								<h:selectOneMenu id="tjmtas" value="#{CoutobjectifachatBean.idEntite}" >
    									<f:selectItems value="#{CoutobjectifachatBean.listEntite}" />
    									<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.entiteByID}" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />
    								</h:selectOneMenu>
     
    								<h:outputLabel><font><h:outputText value="TJM en EUR "/></font><font><h:outputText style="color:red" value="(3) :"/></font></h:outputLabel>		
    								<h:inputText id="tjmeuros"  value="#{CoutobjectifachatBean.coutcible.montanttjm}" disabled="true"  />
     
     
    							</h:panelGrid>
    							<!-- Fin petit panel -->
     
     
     
    							<!-- Petite ligne de séparation dans ce composant-->
    							<br/><rich:separator height="2" lineType="solid"/><br/>
     
    							<!-- Petit panel de 7 colonnes où dans chaque colonne est placé un composant -->
     
     
    							<h:panelGrid columns="8" >	
     
    								<!-- Petit composant qui ai une échelle de pourcentage pour choisir la charge transverse, la value de inputNumberSlider sera à modifier -->
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="(+) Risques "/></font></h:outputLabel>	
    								<h:inputText id="risqueslitigesmontant"  value="#{CoutobjectifachatBean.coutcible.risques}"><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>				
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk"/>	
    								<h:outputLabel><font><h:outputText value="% "/></font><font><h:outputText style="color:red" value="(7) "/></font><font><h:outputText value="soit"/></font></h:outputLabel>		
    								<h:inputText id="risqueslitigesjours" value="#{CoutobjectifachatBean.coutcible.risquesjours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>		
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (8) " title= "Risques JOUR = Risques * Total JOUR == (8)=(7)*(5)"/></font></h:outputLabel>	
    								<h:inputText id="risqueslitigesmontanteuros" value="#{CoutobjectifachatBean.coutcible.risqueseuros}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>									
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (9)" title= "Risques kEUR = Risques * Total kEUR == (9)=(7)*(6)"/></font></h:outputLabel>		
     
    								<!-- Petit composant qui ai une échelle de pourcentage pour choisir la charge transverse, la value de inputNumberSlider sera à modifier -->
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="(-) Opportunités "/></font></h:outputLabel>	
    								<h:inputText id="opprotunitesmontant" value="#{CoutobjectifachatBean.coutcible.opportunite}" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>				
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk"/>	
    								<h:outputLabel><font><h:outputText value="% "/></font><font><h:outputText style="color:red" value="(10) "/></font><font><h:outputText value="soit"/></font></h:outputLabel>		
    								<h:inputText id="opprotunitesjours" value="#{CoutobjectifachatBean.coutcible.opportunitejours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>	
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (11) " title= "Opportunites JOUR = Opportunites * Total JOUR == (11)=(7)*(5)"/></font></h:outputLabel>	
    								<h:inputText id="opprotunitesmontanteuros" value="#{CoutobjectifachatBean.coutcible.opportuniteeuros}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>									
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (12)" title= "Opportunites kEUR = Opportunites * Total kEUR == (12)=(10)*(6)"/></font></h:outputLabel>		
     
     
     
     
     
    							<!-- Petite ligne de séparation dans ce composant-->
    								<h:outputLabel><font><h:outputText value="------------------------------------------------"/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="--------------------------------------------------"/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value="--------------------------------"/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value="---------"/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="--------------------------------"/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="-"/></font></h:outputLabel>		
    								<h:outputLabel><font><h:outputText value="--------------------------------"/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="-------"/></font></h:outputLabel>
    							<!-- Petit panel de 3 colonnes où dans chaque colonne est placé un composant -->
     
     
    								<!-- -->
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="MONTANT TOTAL SANS RISQUES"/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:inputText id="montanttotalsansrisquesjours" value="#{CoutobjectifachatBean.coutcible.montanttotalsansrisquesjours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>	
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (5)" title= "Montant total sans risques jours = Worknomcharge + Charge transverse == (5)=(1)+(2)" /></font></h:outputLabel>		
    								<h:inputText id="montanttotalsansrisqueskeur" value="#{CoutobjectifachatBean.coutcible.montanttotalsansrisqueskeur}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>			
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (6)" title= "Montant total sans risques kEUR = (Worknomcharge + Charge transverse jours)* Tjmeuros == (6)=((1)+(4))*(3)"/></font></h:outputLabel>		
     
     
    								<!--  -->
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>
    								<h:outputLabel><font><h:outputText value="MONTANT TOTAL AVEC RISQUES "/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:outputLabel><font><h:outputText value=""/></font></h:outputLabel>	
    								<h:inputText id="montanttotalavecrisquesjours" value="#{CoutobjectifachatBean.coutcible.montanttotalavecrisquesjours}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>	
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (13)" title= "Montant total avec risques jours = Total jours + Risques jours == (13)=(5)+(8)"/></font></h:outputLabel>		
    								<h:inputText id="montanttotalavecrisqueskeur" value="#{CoutobjectifachatBean.coutcible.montanttotalavecrisqueskeur}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>			
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (14)" title= "Montant total avec risques kEUR = Total kEUR + Risques kEUR == (14)=(6)+(9)"/></font></h:outputLabel>		
    							</h:panelGrid>	
     
    						</rich:panel>
    					<rich:panel style="position:relative;bottom:320px;left:-180px;width:160px;border:0">
     
    							<h:outputLabel><font><u><h:outputText value="Aide pour les formules :" /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<h:panelGrid columns="1" >
    							<h:outputLabel><font><h:outputText style="color:red" value="(4)=(1)*(2)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(5)=(1)+(2)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(6)=((1)+(4))*(3)"/></font></h:outputLabel>		
    							</h:panelGrid>	
    					</rich:panel>
    					<rich:panel style="position:relative;bottom:280px;left:-180px;width:160px;border:0">
     
    							<h:outputLabel><font><u><h:outputText value="Aide pour les formules :" /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<h:panelGrid columns="1" >
    							<h:outputLabel><font><h:outputText style="color:red" value="(8)=(7)*(5)"/></font></h:outputLabel>
    							<h:outputLabel><font><h:outputText style="color:red" value="(9)=(7)*(6)"/></font></h:outputLabel>
    							<h:outputLabel><font><h:outputText style="color:red" value="(11)=(7)*(5)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(12)=(10)*(6)"/></font></h:outputLabel>
    							<h:outputLabel><font><h:outputText style="color:red" value="(13)=(5)+(8)-(11)"/></font></h:outputLabel>
    							<h:outputLabel><font><h:outputText style="color:red" value="(14)=(6)+(9)-(12)"/></font></h:outputLabel>	
     
    							</h:panelGrid>	
    					</rich:panel>
    					<rich:panel style="position:relative;bottom:220px;left:-180px;width:160px;border:0">
     
    							<h:outputLabel><font><u><h:outputText value="Aide pour les formules :" /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<h:panelGrid columns="1" >
    							<h:outputLabel><font><h:outputText style="color:red" value="(16)=(17)/(3)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(17)=(15)*(6)"/></font></h:outputLabel>	
    							<h:outputLabel><font><h:outputText style="color:red" value="(19)=((14)-(17))/(18)"/></font></h:outputLabel>	
    							</h:panelGrid>	
    					</rich:panel>
     
    					<rich:panel style="position:relative;bottom:330px;left:0px;width:980px;">
     
    							<h:outputLabel><font><u><h:outputText value="BUY : Si les travaux sont  sous traités " /></u></font></h:outputLabel>
    							<br/>
    							<br/>
    							<!-- Petit panel de 2 colonnes où dans chaque colonne est placé un composant -->
    							<h:panelGrid columns="7" >
     
    								<!-- Petit composant qui ai une échelle de pourcentage pour suivi du fournisseur (FRN), la value de inputNumberSlider sera à modifier -->
    								<h:outputLabel><font><h:outputText value="Part de suivi du FRN par TSA"/></font><font><h:outputText style="color:red" value=" (15) :"/></font></h:outputLabel>	
    								<h:inputText id="suivifournisseur" converter="#{Integer}" required="true" value="#{CoutobjectifachatBean.coutcible.suivifrn}" />								
     
    								<a4j:support event="onkeyup" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />														 
    								<h:outputLabel><font><h:outputText value="% soit"/></font></h:outputLabel>					
    								<h:inputText id="suivifournisseurjours" value="#{CoutobjectifachatBean.coutcible.suivifournisseurjours}" disabled="true"  ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="1" ></f:convertNumber></h:inputText>		
    								<h:outputLabel><font><h:outputText value="j"/></font><font><h:outputText style="color:red" value=" (16)" title= "Suivi FRN jours = Suivi FRN kEUR / Tjmeuros == (16)=(17)/(3)"/></font></h:outputLabel>		
    								<h:inputText id="suivifournisseureuros" value="#{CoutobjectifachatBean.coutcible.suivifournisseureuros}" disabled="true"  ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>				
    								<h:outputLabel><font><h:outputText value="EUR"/></font><font><h:outputText style="color:red" value=" (17)" title= "Suivi FRN kEUR = Suivi FRN * Total kEUR == (17)=(15)*(6)"/></font></h:outputLabel>	
     
     
     
     
    								<!-- Petit panel de 4 colonnes où dans chaque colonne est placé un composant -->
    								<h:panelGrid columns="2" >	
     
    									<h:outputLabel><font><h:outputText value="Coef d'appro : "/></font><font><h:outputText style="color:red" value=" (18) :"/></font></h:outputLabel>
     
    									<!-- Choisir une entite dans la liste déroulante -->
    									<h:selectOneMenu id="coef" value="#{CoutobjectifachatBean.idCoefappro}" >
    										<f:selectItems value="#{CoutobjectifachatBean.listCoefappro}" />
    										<a4j:support event="onchange" actionListener="#{CoutobjectifachatBean.coefapproByID}" reRender="chargetransversejour,totaljours,totalkeur,montanttotalsansrisqueskeur,montanttotalsansrisquesjours,montanttotalavecrisqueskeur,montanttotalavecrisquesjours,suivifournisseureuros,suivifournisseurjours,tjmeuros,risqueslitigesjours,opprotunitesjours,risqueslitigesmontanteuros,opprotunitesmontanteuros,mandat,coefk" />
    									</h:selectOneMenu>
     
    									<h:outputLabel><font><h:outputText value="Coef "/></font><font><h:outputText style="color:red" value="(18) :"/></font></h:outputLabel>		
    									<h:inputText id="coefk"  value="#{CoutobjectifachatBean.coutcible.k}" disabled="true"  />
     
     
    								</h:panelGrid>
    								<!-- Fin petit panel -->	
     
     
     
    							</h:panelGrid>	
    							<h:panelGrid columns="3" >	
     
    								<h:outputLabel><font><h:outputText value="PART MAXIMALE (MANDAT)"/></font><font><h:outputText style="color:red" value=" (19) = " title= "MANDAT = (Total kEUR - Suivi FRN kEUR) / Coeff d'appro == (19)=((6)-(17))/(18)"/></font></h:outputLabel>	
    								<h:inputText id="mandat" value="#{CoutobjectifachatBean.coutcible.mandat}" disabled="true" ><f:convertNumber groupingUsed="#{true}" maxFractionDigits="0" ></f:convertNumber></h:inputText>			
    								<h:outputLabel><font><h:outputText value="kEUR"/></font></h:outputLabel>	
     
    							</h:panelGrid>	
    							<!-- Fin petit panel -->
     
    							<h:message style="color: red; text-decoration: none;margin-left:100px;" id="registerError" for="cBValider"/><br />
     
    						</rich:panel>
     
    							<h:panelGroup style="position:relative;bottom:300px;margin-left:160px;">
    								<h:commandButton id="cBValider" action="#{CoutobjectifachatBean.valider}"  value="OK" title="Cliquez ici pour insérer un cout cible dans la base"  /><rich:spacer width="10px" />
    								<a4j:commandButton action="#{CoutobjectifachatBean.annuler}" value="Annuler" reRender="BesoinForm"/>			
    							</h:panelGroup>
     
    					</h:form>
     
    		  		</div>
    		    </div>
     
        <div id="footer">
          <hr />
     
        </div>
     
    </f:view>
    </body>
    </html>

    Ca ne fonctionne pas et cela ne met pas d'erreur aussi.

  17. #17
    Membre expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2007
    Messages
    2 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2007
    Messages : 2 938
    Points : 3 938
    Points
    3 938
    Par défaut
    Mets une alerte déjà pour voir si la fonction est appelée.
    Vous avez peut être hâte de réussir et il n'y a rien de mal à cela...
    mais la patience est aussi une vertu; l'échec vous l'enseignera certainement..."

  18. #18
    Membre expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2007
    Messages
    2 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2007
    Messages : 2 938
    Points : 3 938
    Points
    3 938
    Par défaut
    Et autre détail, RichFaces te rajoute normalement dans l'id de chaque composant l'id du formulaire suivi de ton id à toi, donc si tu avais mis un id sur ton formulaire pour recuperer ton champ input tu ferais un truc du genre
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    field = document.getElementById("ton_id_formulaire:worknomcharge");
    , j'ai vu que t'avais pas mis d'id à ton formulaire, mets en un.
    Vous avez peut être hâte de réussir et il n'y a rien de mal à cela...
    mais la patience est aussi une vertu; l'échec vous l'enseignera certainement..."

  19. #19
    Membre à l'essai
    Inscrit en
    Juillet 2010
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Juillet 2010
    Messages : 74
    Points : 15
    Points
    15
    Par défaut
    Grand merci DevServlet, çà marche.

    En fait j'ai mis un id au formulaire, mais dans ta fonction

    field = document.getElementById("ton_id_formulaire:worknomcharge");

    je ne l'avais pas mis. Mais une fois rajouter ca marche maintenant. Merci, merci et encore merci pour ton aide.

  20. #20
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    +1 tu dois mettre l'id complet. Je suis un peu rouillé en JS, mais pour la facilité, il faut probablement mieux que tu fasse ça:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    function forbitTextChar(field)
    {
    	value = field.value;
    	if (value.length !=0 && isNaN(value.substring(value.length-1)))
    	{
    			field.value = value.substring(0, value.length - 1);
    	}
    }
    et plus loin
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <h:inputText ..... onkeyup="forbitTextChar(this);">....

    Maintenant ta méthode est très basique, elle ne vérifie que le dernier caractère, hors n'importe quel caractère peu être erroné, pas seulement le denier sir on fait des inserrtion en début de champ.

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. Mask de saisie ajax ne fonctionne pas
    Par shonem dans le forum ASP.NET Ajax
    Réponses: 8
    Dernier message: 31/08/2010, 15h41
  2. controle saisie JSP
    Par wikisoft dans le forum Servlets/JSP
    Réponses: 1
    Dernier message: 08/03/2009, 22h34
  3. Un mask de saisie appliqué à un DBEdit
    Par souminet dans le forum Débuter
    Réponses: 6
    Dernier message: 13/04/2008, 15h33
  4. mask de saisie sur un dbmemo?
    Par dj_techno dans le forum Bases de données
    Réponses: 2
    Dernier message: 22/08/2006, 09h01
  5. [Plugin] un éditeur JSP avec aide à la saisie GRATUIT ?
    Par DemonKN dans le forum Eclipse Java
    Réponses: 5
    Dernier message: 29/03/2005, 15h55

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo