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 :

des listes dépendantes


Sujet :

Servlets/JSP Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Inscrit en
    Novembre 2006
    Messages
    304
    Détails du profil
    Informations personnelles :
    Âge : 41

    Informations forums :
    Inscription : Novembre 2006
    Messages : 304
    Par défaut des listes dépendantes
    bonjour, j'ai trois listes dépendantes : une pour projet, et l'autre pour les sous projets et la troisième pour les activités chacune alimente l'autre, mais par exemple lorsqu'il y a un sous projet qui ne contient pas des activités elle m'affiche les dernières activités du dernier sous projet séléctionné ? donc ma question est comment puis je initialisé ces listes dans ce cas ?

  2. #2
    Membre Expert
    Avatar de fabszn
    Homme Profil pro
    Développeur Java
    Inscrit en
    Mars 2002
    Messages
    974
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Mars 2002
    Messages : 974
    Par défaut
    Hello,

    Je pense qu'il va falloir développer un peu ta problématique.

    Environnement technique
    montrer un peu de code
    etc..

    Car avec les éléments que tu as donnés ca va être dur de te répondre..

  3. #3
    Membre chevronné
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    376
    Détails du profil
    Informations personnelles :
    Âge : 44
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 376
    Par défaut
    Oui, et ma première question sera : comment tu recharges tes combos à chaque changement de valeur ? (traitement serveur ou client ?)

  4. #4
    Membre éclairé
    Inscrit en
    Novembre 2006
    Messages
    304
    Détails du profil
    Informations personnelles :
    Âge : 41

    Informations forums :
    Inscription : Novembre 2006
    Messages : 304
    Par défaut
    voila :
    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
    <%@ include file="inc_connexion_auth.jsp" %>
    <html>
    <head>
    <title>Feuilles de temps </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="style.css" rel="stylesheet" type="text/css">
    <SCRIPT language=javascript src="tiny_mce/tiny_mce.js"></script>
    <SCRIPT language=javascript type=text/javascript>
    	tinyMCE.init({
    		theme : "advanced",
    		mode : "exact",
    		elements : "elm1",
    		language : "fr",	
    		save_callback : "customSave",
    		content_css : "../script/skin1.css",
    		theme_advanced_toolbar_location : "top",
    		theme_advanced_disable : "separator,removeformat,code,hr,sub,sup,image,cleanup,anchor,help,formatselect,charmap,outdent,indent,strikethrough,visualaid,anchor,zoom,row_before",
    		theme_advanced_buttons1_add :"sub,sup,charmap",
    		//invalid_elements : "a",
    		theme_advanced_styles : "Normal =texte;Titre=text_v;Titre 2=mcr;Texte+=texte11;Lien=texte_lien", // Theme specific setting CSS classes
    		//execcommand_callback : "myCustomExecCommandHandler",
    		debug : false
    	});
    
    	// Custom event handler
    	function myCustomExecCommandHandler(editor_id, elm, command, user_interface, value) {
    		var linkElm, imageElm, inst;
    
    		switch (command) {
    			case "mceLink":
    				inst = tinyMCE.getInstanceById(editor_id);
    				linkElm = tinyMCE.getParentElement(inst.selection.getFocusElement(), "a");
    
    				if (linkElm)
    					alert("Link dialog has been overriden. Found link href: " + tinyMCE.getAttrib(linkElm, "href"));
    				else
    					alert("Link dialog has been overriden.");
    
    				return true;
    
    			case "mceImage":
    				inst = tinyMCE.getInstanceById(editor_id);
    				imageElm = tinyMCE.getParentElement(inst.selection.getFocusElement(), "img");
    
    				if (imageElm)
    					alert("Image dialog has been overriden. Found image src: " + tinyMCE.getAttrib(imageElm, "src"));
    				else
    					alert("Image dialog has been overriden.");
    
    				return true;
    		}
    
    		return false; // Pass to next handler in chain
    	}
    
    	// Custom save callback, gets called when the contents is to be submitted
    	/*function customSave(id, content) {
    		
    		alert ("sddsqdf");
    	}*/
    		function customSave(id, content) {
    		document.getElementById("elm1").value=content;
    	}
    </SCRIPT>
    <script language="javascript">
    function switchImage(imgName, imgSrc) 
    {
      if (document.images)
      {
        if (imgSrc != "none")
        {
          document.images[imgName].src = imgSrc;
        }
      }
    }
    </script>
    
    <script language="javascript">
    function envoyer(boutton){
    if(boutton=="modifier"){
    document.projet.action = 'modifprojet.jsp'; 
    document.projet.submit();
    }
    	if(boutton=="supprimer"){
    			if(confirm('Voulez-vous vraiment Supprimer cet projet ?')) 
    			{
    			document.projet.action = 'Trsupprojet.jsp'; 
    			document.projet.submit();
    			};
    	}
    }
    </script>
    
    </head>
    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <table width="800" height="478" border="0" align="center" cellpadding=4 cellspacing="0" id="Tableau_01" style="border:solid 1px #99CC66">
    	<tr>
    		<td height="155"><img src="images/index_01.jpg" width="800" height="147" alt=""></td>
    	</tr>
    	<tr>
    	  <td valign=top>
    	  <form name="pointage" action="" method="get">
    	  <table width="100%" height="361" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="73"><TABLE WIDTH=788 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
    	
    	<TR>
    		<TD width="13">&nbsp;</TD>
    		<TD width="75">
    			<IMG SRC="images/menuorigine_21.gif" WIDTH=57 HEIGHT=73 ALT="" name="img21" onmouseover='switchImage("img21", "images/menusurvol_21.gif")' onmouseout='switchImage("img21", "images/menuorigine_21.gif")'></TD>
    		<TD width="3">
    			<IMG SRC="images/menuorigine_22.gif" WIDTH=3 HEIGHT=73 ALT="" ></TD>
    		<TD width="62">
    			<IMG SRC="images/menuorigine_23.gif" WIDTH=43 HEIGHT=73 ALT="" name="img23" onmouseover='switchImage("img23", "images/menusurvol_23.gif")' onmouseout='switchImage("img23", "images/menuorigine_23.gif")'>		</TD>
    		<TD width="23">
    			<IMG SRC="images/menuorigine_24.gif" WIDTH=18 HEIGHT=73 ALT=""></TD>
    		<TD width="58">
    			<IMG SRC="images/menuorigine_25.gif" WIDTH=44 HEIGHT=73 ALT="" name="img25" onmouseover='switchImage("img25", "images/menusurvol_25.gif")' onmouseout='switchImage("img25", "images/menuorigine_25.gif")'></TD>
    		<TD width="19">
    			<IMG SRC="images/menuorigine_26.gif" WIDTH=15 HEIGHT=73 ALT=""></TD>
    		<TD width="75">
    			<IMG SRC="images/menuorigine_27.gif" WIDTH=57 HEIGHT=73 ALT="" name="img27" onmouseover='switchImage("img27", "images/menusurvol_27.gif")' onmouseout='switchImage("img27", "images/menuorigine_27.gif")'></TD>
    		<TD width="6">
    			<IMG SRC="images/menuorigine_28.gif" WIDTH=5 HEIGHT=73 ALT="" ></TD>
    		<TD width="71">
    			<IMG SRC="images/menuorigine_29.gif" WIDTH=54 HEIGHT=73 ALT="" name="img29" onmouseover='switchImage("img29", "images/menusurvol_29.gif")' onmouseout='switchImage("img29", "images/menuorigine_29.gif")'></TD>
    		<TD width="6">
    			<IMG SRC="images/menuorigine_30.gif" WIDTH=5 HEIGHT=73 ALT=""></TD>
    		<TD width="56">
    			<IMG SRC="images/menuorigine_31.gif" WIDTH=43 HEIGHT=73 ALT="" name="img31" onmouseover='switchImage("img31", "images/menusurvol_31.gif")' onmouseout='switchImage("img31", "images/menuorigine_31.gif")'></TD>
    		<TD width="21">
    			<IMG SRC="images/menuorigine_32.gif" WIDTH=16 HEIGHT=73 ALT=""></TD>
    		<TD width="45">
    			<IMG SRC="images/menuorigine_33.gif" WIDTH=45 HEIGHT=73 ALT="" name="img33" onmouseover='switchImage("img33", "images/menusurvol_33.gif")' onmouseout='switchImage("img33", "images/menuorigine_33.gif")'></TD>
    		<TD width="14">
    			<IMG SRC="images/menuorigine_34.gif" WIDTH=14 HEIGHT=73 ALT=""></TD>
    		<TD width="47">
    			<IMG SRC="images/menuorigine_35.gif" WIDTH=47 HEIGHT=73 ALT="" name="img35" onmouseover='switchImage("img35", "images/menusurvol_35.gif")' onmouseout='switchImage("img35", "images/menuorigine_35.gif")' ></TD>
    		<TD width="55">
    			<IMG SRC="images/menuorigine_36.gif" WIDTH=55 HEIGHT=73 ALT=""></TD>
    
    
    
    		<TD width="50">
    			<IMG SRC="images/menuorigine_37.gif" WIDTH=50 HEIGHT=73 ALT="" name="img37" onmouseover='switchImage("img37", "images/menusurvol_37.gif")' onmouseout='switchImage("img37", "images/menuorigine_37.gif")'></TD>
    		<TD width="89" background="images/menuorigine_36.gif">&nbsp;</TD>
    	</TR>
    </TABLE></td>
      </tr>
      <tr>
        <td height="40">	
    	<table width="20%" border="0" align="center" cellpadding="10" cellspacing="0">
          <tr>
            <th scope="col"><a href="ajoutprojet.jsp"><img src="images/ajouter.jpg" border="0" class="ajoutermenu"></a><a href="ajoutprojet.jsp"></a></th>
            <th scope="col">&nbsp;</th>
            <th scope="col">
              <input name="modifier" type="button" class="modifier" value="" onClick='envoyer("modifier");' >        </th>
            <th scope="col">&nbsp;</th>
            <th scope="col"><input name="supprimer" type="button" class="supprimer" value="" onClick='envoyer("supprimer");'></th>
          </tr>
        </table>	</td>
      </tr>
      	<%!
       public String formater(int Number) 
       {
       String strdate="";
       if(Number < 10){
       strdate="0" + String.valueOf(Number);
       return strdate;
       };
       return String.valueOf(Number);
       } 
    		Calendar c = Calendar.getInstance();
    
    	String datesys =  formater(c.get(c.DAY_OF_MONTH))+"/"+formater((c.get(c.MONTH)+1))+"/"+c.get(c.YEAR);
    	%>
       <tr><td><TABLE WIDTH="43%" align="center"><tr><td class="titre"> Feuille de temps du : <% out.println(datesys); %> - Mrx -</td></tr></TABLE></td></tr>
      <tr>
         <td>
      <TABLE WIDTH="64%" align="center">
        <tr class="ligne2">
        <td width="37%" class="labels">D&eacute;but&nbsp;(hh/mm) :</td>
    	<td width="14%"><select name="select">
    <option value=0 >00</option>
    <option value=1 >01</option>
    <option value=2 >02</option>
    <option value=3 >03</option>
    <option value=4 >04</option>
    <option value=5 >05</option>
    <option value=6 >06</option>
    <option value=7 selected>07</option>
    <option value=8 >08</option>
    <option value=9 >09</option>
    <option value=10 >10</option>
    <option value=11 >11</option>
    <option value=12 >12</option>
    <option value=13 >13</option>
    <option value=14 >14</option>
    <option value=15 >15</option>
    <option value=16 >16</option>
    <option value=17 >17</option>
    <option value=18 >18</option>
    <option value=19 >19</option>
    <option value=20 >20</option>
    <option value=21 >21</option>
    <option value=22 >22</option>
    <option value=23 >23</option>
    	  </select>	</td>
    	<td width="4%">:</td>
    	<td width="45%" class="zcontenu"><select name="select2">
    <option value="0" selected>00</option>
    <option value="15" >15</option>
    <option value="30" >30</option>
    <option value="45" >45</option>
            </select></td>
        </tr> 
      <TR class="ligne1">
           <TD class="labels">Fin&nbsp;(hh/mm) :  </TD>
    	   <td class="zcontenu"><select name="select3">
    <option value=0 >00</option>
    <option value=1 >01</option>
    <option value=2 >02</option>
    <option value=3 >03</option>
    <option value=4 >04</option>
    <option value=5 >05</option>
    <option value=6 >06</option>
    <option value=7 selected>07</option>
    <option value=8 >08</option>
    <option value=9 >09</option>
    <option value=10 >10</option>
    <option value=11 >11</option>
    <option value=12 >12</option>
    <option value=13 >13</option>
    <option value=14 >14</option>
    <option value=15 >15</option>
    <option value=16 >16</option>
    <option value=17 >17</option>
    <option value=18 >18</option>
    <option value=19 >19</option>
    <option value=20 >20</option>
    <option value=21 >21</option>
    <option value=22 >22</option>
    <option value=23 >23</option>
    <option value=0 >00</option>
           </select></td>  
    	   <td>:</td>
    	   <td class="zcontenu"><select name="select4">
    <option value="0" selected>00</option>
    <option value="15" >15</option>
    <option value="30" >30</option>
    <option value="45" >45</option>
           </select></td>
      </TR>
      <TR class="ligne2">
        <TD class="labels">Projet : </TD>
        <td colspan="3" class="zcontenu"><% String prj=request.getParameter("zprj");%> 
    		<select name="zprj" id="zprj" style="width:152" onChange="document.pointage.submit();">
    		  <%		    		    
    			String requete1="SELECT * FROM projet,client where projet.Id_Cl=client.Id_Cl";
        		rs = st.executeQuery(requete1);
        		while(rs.next()){ 
      		 %> 
    <option value="<%=rs.getInt("Id_Prj") %>" <%
    if(prj!=null){
    if(rs.getInt("Id_Prj") == Integer.parseInt(prj)){
     out.println("selected");
     }
     } %>><%=rs.getString("Rai_Soc") %> - <%=rs.getString("Nom_Prj") %></option>
      <% 
      } 
      %>     
            </select></td>
      </TR>
      <TR class="ligne1">
        <TD class="labels">Sous projet : </TD>
        <td colspan="3" class="zcontenu"><select name="zsprj" style="width:152" onChange="document.pointage.submit();">
    		<%		
    		    String sprj=request.getParameter("zsprj");
    			
    			String requete2="SELECT * FROM sousprojet where Id_Prj="+ prj;			
        		rs = st.executeQuery(requete2);
        		while(rs.next()){   
      		%> 
               <option value="<%=rs.getInt("Id_SPrj") %>" 
    <%
    if(sprj!=null){
    if(rs.getInt("Id_SPrj") == Integer.parseInt(sprj)){
     out.println("selected");
     }
     } %>><%=rs.getString("Nom_SPrj") %></option>
    	    <% 
    	    } 
    	    %> 
            </select></td>
      </TR>
      <TR class="ligne2">
           <TD><span class="labels">Activit&eacute; </span>:</TD>
    	   <td colspan="3" class="zcontenu"><select name="zact" style="width:152" onChange="document.pointage.submit();">
             <%		
    		    String act=request.getParameter("zact");
    			
    			String requete3="SELECT * FROM activite where Id_SPrj="+ sprj;			
        		rs = st.executeQuery(requete3);
        		while(rs.next()){   
      		%>
             <option value="<%=rs.getInt("Id_Act") %>" 
    <%
    if(act!=null){
    if(rs.getInt("Id_Act") == Integer.parseInt(act)){
     out.println("selected");//afin de sélectionner le nom qu'on a déjà sélectionner aprés le rechargement de la page
     }
     } %>><%=rs.getString("Nom_Act") %></option>
             <% 
    	    } 
    	    %>
           </select></td>  
      </TR>  <TR class="ligne1" height="100">
           <TD class="labels">Commentaire :</TD>
    	   <td colspan="3"><TEXTAREA name="elm1" style="WIDTH: 100%" ></TEXTAREA>
    	   </td>
      </TR> 
      </TABLE>     </td>
      </tr>
    </table>
         </form>	  </td>
    	</tr>
    	<tr>
    		<td><img src="images/index_03.jpg" width="800" height="91" alt=""></td>
    	</tr>
    </table>
    </body>
    </html>

Discussions similaires

  1. [servlet] gestion des listes d'erreurs ?
    Par MatMeuh dans le forum Servlets/JSP
    Réponses: 8
    Dernier message: 27/10/2004, 10h19
  2. [html:text][indexed]Valeurs des liste null...
    Par thibaut dans le forum Servlets/JSP
    Réponses: 13
    Dernier message: 08/09/2004, 09h36
  3. [glut] de l'intérêt des listes
    Par khayyam90 dans le forum OpenGL
    Réponses: 3
    Dernier message: 26/07/2004, 10h35
  4. [langage] probleme avec les listes dans des listes
    Par pqmoltonel dans le forum Langage
    Réponses: 7
    Dernier message: 27/04/2004, 12h32
  5. Actualisation d'une liste "dépendante".
    Par Trilby dans le forum ASP
    Réponses: 6
    Dernier message: 19/11/2003, 18h39

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