Changeset 436 for geisa/web


Ignore:
Timestamp:
03/23/12 14:56:32 (12 years ago)
Author:
npipsl
Message:

liste déroulante

Location:
geisa/web
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • geisa/web/initGeisa.jsp

    r435 r436  
    88    <tiles:put name="insertCss" type="string"> 
    99        <ether:htmlCss cssFile="geisa"/> 
     10        <ether:htmlCss cssFile="select"/> 
    1011    </tiles:put> 
    1112    <tiles:put name="insertJsOrJsp" type="string"> 
    1213        <ether:htmlJsp jspFile="init_scriptGeisa"></ether:htmlJsp> 
     14        <ether:htmlJs jsFile="classesForJQuery/Select"/> 
    1315    </tiles:put> 
    1416 
     
    5860 
    5961 
    60             function handleOnClickSubmit(result) 
    61             { 
    62                 var bob = jQuery.parseJSON( result ).resultAjax; 
    63                 alert(bob); 
    64                 var pathImg = jQuery.parseJSON( result ).pathImg; 
    65                 alert(pathImg); 
    66                 var img = $(document.createElement("img")); 
     62//            function handleOnClickSubmit(result) 
     63//            { 
     64//                var bob = jQuery.parseJSON( result ).resultAjax; 
     65//                alert(bob); 
     66//                var pathImg = jQuery.parseJSON( result ).pathImg; 
     67//                alert(pathImg); 
     68//                var img = $(document.createElement("img")); 
     69// 
     70//               //img.attr({src:pathImg, width:"200px", height:"200px"}); 
     71//               img.attr({src:pathImg}); 
     72// 
     73////<img src="zrzer" width="100px" height="100px"/> 
     74// 
     75//                $("#graphique").append(img); 
     76// 
     77//                var selectValue = getSelectValue('trace_select_id'); 
     78//                alert(selectValue); 
     79//                            } 
    6780 
    68                //img.attr({src:pathImg, width:"200px", height:"200px"}); 
    69                img.attr({src:pathImg}); 
    70  
    71 //<img src="zrzer" width="100px" height="100px"/> 
    72  
    73                 $("#graphique").append(img); 
    74  
    75                 var selectValue = getSelectValue('trace_select_id'); 
    76                 alert(selectValue); 
    77                             } 
    78  
    79             function onClickSubmit(){ 
    80                 $.ajax( { 
    81                             url: "project?methodName=createUserRequest&check1="+$("#chk-h2o_Bob").attr('checked')+"&check2="+$("#chk-h2o_Bob").val(), 
    82                             success:handleOnClickSubmit 
    83                         } ); 
    84             } 
     81//            function onClickSubmit(){ 
     82<%----%> 
     83//                $.ajax( { 
     84//                            url: "project?methodName=createUserRequest&check1="+$("#chk-h2o_Bob").attr('checked')+"&check2="+$("#chk-h2o_Bob").val(), 
     85//                            success:handleOnClickSubmit 
     86//                        } ); 
     87//            } 
    8588 
    8689 
    8790 
    88             var submitButton = new Button( {value:"Submit", parent:$("#boutonSubmit"), id:"button_submit_2", className: "red_button", classNameText:"red_button_text", onClick:onClickSubmit} ); 
     91//            var submitButton = new Button( {value:"Submit", parent:$("#boutonSubmit"), id:"button_submit_2", className: "red_button", classNameText:"red_button_text", onClick:onClickSubmit} ); 
    8992 
    9093 
  • geisa/web/init_scriptGeisa.jsp

    r435 r436  
    107107                    // Create menu deroulant 
    108108 
    109                     var arrVar= new Array("Lignes","Points","Piques","Lignes et Points"); 
    110                     var place_select = document.getElementById('box4'); 
    111                     var trace_select = document.createElement('select'); 
    112                         //donner un id au select 
    113                     //trace_select.attr( {id:"5"} ); 
    114                     trace_select.setAttribute("id","trace_select_id"); 
     109                    var paramSelect = new Object(); 
     110                    paramSelect.id = "trace_select_id"; 
     111                    paramSelect.parent = $("#box4"); 
     112                    this.selectTrace = new Select( paramSelect ); 
     113                    this.selectTrace.add( '-line_type l', "Lignes" ); 
     114                    this.selectTrace.add( '-line_type p', "Points" ); 
     115                    this.selectTrace.add( '-line_type i', "Piques" ); 
     116                    this.selectTrace.add( '-line_type lp', "Lignes et Points" ); 
     117                    this.selectTrace.selectFirst( false ); 
    115118 
    116119 
    117  
    118                      //true indique celui qui est sélectionné par défaut 
    119                     trace_select.options[0] = new Option(arrVar[0], '-line_type l',true); 
    120                     trace_select.options[1] = new Option(arrVar[1], '-line_type p',false); 
    121                     trace_select.options[2] = new Option(arrVar[2], '-line_type i',false); 
    122                     trace_select.options[3] = new Option(arrVar[3], '-line_type lp',false); 
    123  
    124                     // trace_select.options[0].selected="selected"; // choisir celui sélectionné 
    125                     place_select.appendChild(trace_select); 
     120//                    var arrVar= new Array("Lignes","Points","Piques","Lignes et Points"); 
     121//                    var place_select = document.getElementById('box4'); 
     122//                    var trace_select = document.createElement('select'); 
     123//                    //donner un id au select 
     124//                    //trace_select.attr( {id:"5"} ); 
     125//                    trace_select.setAttribute("id","trace_select_id"); 
     126// 
     127// 
     128// 
     129//                    //true indique celui qui est sélectionné par défaut 
     130//                    trace_select.options[0] = new Option(arrVar[0], '-line_type l',true); 
     131//                    trace_select.options[1] = new Option(arrVar[1], '-line_type p',false); 
     132//                    trace_select.options[2] = new Option(arrVar[2], '-line_type i',false); 
     133//                    trace_select.options[3] = new Option(arrVar[3], '-line_type lp',false); 
     134// 
     135//                    // trace_select.options[0].selected="selected"; // choisir celui sélectionné 
     136//                    place_select.appendChild(trace_select); 
    126137 
    127138 
    128139                    // Create bouton 
    129140 
    130                     var submitButton = new Button( {value:initTexts["label.submitButton"], parent:this.containerForm1, id:"button_submit1", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickSubmit, this )} ); 
    131  
     141//                    var submitButton = new Button( {value:initTexts["label.submitButton"], parent:this.containerForm1, id:"button_submit1", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickSubmit, this )} ); 
     142                    var submitButton = new Button( {value:"Submit", parent:$("#boutonSubmit"), id:"button_submit_2", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickSubmit, this )} ); 
    132143                }, 
    133144 
    134145 
    135146                // REQUESTS ******************************************************** 
    136                 requestCreateXML: function() 
     147                requestGeisa: function() 
    137148                { 
    138                     alert(this.input1.val()+' - '+$("#2").val()+' - '+$("#3").val()); 
     149                    var parameters = "check1="+$("#chk-h2o_Bob").attr('checked')+"&check2="+$("#chk-h2o_Bob").val(); 
    139150                    $.ajax( { 
    140                                 url: "project?methodName=createUserRequest&input1="+this.input1.val()+"&input2="+$("#2").val()+"&input3="+$("#3").val(), 
    141                                 success:jQuery.proxy( this.handleCreateXML, this ) 
     151                                url: "project?methodName=createUserRequest&"+parameters, 
     152                                success:jQuery.proxy( this.handleGeisa, this ) 
    142153                            } ); 
     154 
     155 
     156//                    alert(this.input1.val()+' - '+$("#2").val()+' - '+$("#3").val()); 
     157//                    $.ajax( { 
     158//                                url: "project?methodName=createUserRequest&input1="+this.input1.val()+"&input2="+$("#2").val()+"&input3="+$("#3").val(), 
     159//                                success:jQuery.proxy( this.handleCreateXML, this ) 
     160//                            } ); 
    143161                }, 
    144162 
    145163                // HANDLES ******************************************************** = retours ajax 
    146                 handleCreateXML: function( result ) 
     164                handleGeisa: function( result ) 
    147165                { 
    148 //            alert("XML créé"); 
    149                     var bob = jQuery.parseJSON( result ).result; 
     166                    var bob = jQuery.parseJSON( result ).resultAjax; 
    150167                    alert(bob); 
     168                    var pathImg = jQuery.parseJSON( result ).pathImg; 
     169                    alert(pathImg); 
     170                    var img = $(document.createElement("img")); 
     171 
     172                   //img.attr({src:pathImg, width:"200px", height:"200px"}); 
     173                   img.attr({src:pathImg}); 
     174 
     175//<img src="zrzer" width="100px" height="100px"/> 
     176 
     177                    $("#graphique").append(img); 
     178 
     179                    var selectValue = getSelectValue('trace_select_id'); 
     180                    alert(selectValue); 
     181 
    151182 
    152183                }, 
    153184 
    154  
    155185                // EVENTS ******************************************************** 
    156  
    157186                onClickSubmit: function() 
    158187                { 
    159                     this.requestCreateXML(); 
     188                    this.requestGeisa(); 
    160189                } 
    161190 
Note: See TracChangeset for help on using the changeset viewer.