source: Ballon/web/init_script.jsp @ 848

Last change on this file since 848 was 766, checked in by npipsl, 11 years ago
File size: 1.8 KB
Line 
1<script type="text/javascript">
2    var InterfaceInit = Class.create( {
3
4        initialize: function()
5        {
6            /** *********** CONTAINERS *********** **/
7            this.containerForm = $( "#formulaire" );
8
9            this.createForm();
10        },
11
12        // CREATES ********************************************************
13        createForm: function()
14        {
15            // Create button elements
16            this.input1 = $( document.createElement( "input" ) );
17            var input2 = $( document.createElement( "input" ) );
18
19            this.input1.attr( {id:"1"} );
20            this.containerForm.append( this.input1 );
21
22            input2.attr( {id:"2"} );
23            this.containerForm.append( input2 );
24
25            var submitButton = new Button( {value:initTexts["label.submitButton"], parent:this.containerForm, id:"button_submit", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickSubmit, this )} );
26
27        },
28
29
30        // REQUESTS ********************************************************
31        requestCreateXML: function()
32        {
33//            alert(this.input1.val()+' - '+$("#2").val());
34            $.ajax( {
35                url: "project?methodName=createUserRequest&input1="+this.input1.val()+"&input2="+$("#2").val(),
36                success:jQuery.proxy( this.handleCreateXML, this )
37            } );
38        },
39
40        // HANDLES ******************************************************** = retours ajax
41        handleCreateXML: function( result )
42        {
43//            alert("XML créé");
44            var bob = jQuery.parseJSON( result ).result;
45            alert(bob);
46
47        },
48
49
50        // EVENTS ********************************************************
51
52        onClickSubmit: function()
53        {
54            this.requestCreateXML();
55        }
56
57
58    } );
59
60
61</script>
Note: See TracBrowser for help on using the repository browser.