Subversion Repositories eFlore/Applications.cel

Rev

Rev 147 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 147 Rev 972
Line 6... Line 6...
6
import com.google.gwt.http.client.RequestBuilder;
6
import com.google.gwt.http.client.RequestBuilder;
7
import com.google.gwt.http.client.RequestCallback;
7
import com.google.gwt.http.client.RequestCallback;
8
import com.google.gwt.http.client.RequestException;
8
import com.google.gwt.http.client.RequestException;
9
import com.google.gwt.http.client.Response;
9
import com.google.gwt.http.client.Response;
10
import com.google.gwt.json.client.JSONArray;
10
import com.google.gwt.json.client.JSONArray;
-
 
11
import com.google.gwt.json.client.JSONObject;
11
import com.google.gwt.json.client.JSONParser;
12
import com.google.gwt.json.client.JSONParser;
12
import com.google.gwt.json.client.JSONString;
13
import com.google.gwt.json.client.JSONString;
13
import com.google.gwt.json.client.JSONValue;
14
import com.google.gwt.json.client.JSONValue;
14
import com.google.gwt.user.client.Window;
15
import com.google.gwt.user.client.Window;
Line 43... Line 44...
43
					final JSONValue responseValue = JSONParser.parse(response.getText());
44
					final JSONValue responseValue = JSONParser.parse(response.getText());
44
					JSONArray reponse = responseValue.isArray();
45
					JSONArray reponse = responseValue.isArray();
Line 45... Line 46...
45
					
46
					
Line 46... Line 47...
46
					if(reponse != null) {
47
					if(reponse != null) {
Line 47... Line 48...
47
						
48
						
Line 48... Line 49...
48
						util = new String[reponse.size()][1];
49
						util = new String[reponse.size()][2];
Line 49... Line 50...
49
						
50
						
-
 
51
						for(int i = 0; i < reponse.size() ; i++) {
50
						for(int i = 0; i < reponse.size() ; i++) {
52
							
51
							
53
							 JSONObject item = reponse.get(i).isObject(); 
52
							 JSONString item = reponse.get(i).isString(); 
54
							
53
							
55
							if(item != null) {
54
							if(item != null) {
56
								util[i][0] = item.get("id_utilisateur").isString().stringValue();
55
								util[i][0] = item.stringValue();
57
								util[i][1] = item.get("courriel").isString().stringValue();
56
							}
58
							}
Line 57... Line 59...
57
						}
59
						}
58
					}
60
					}
59
					else {
61
					else {
Line 60... Line 62...
60
						util = new String[0][1];
62
						util = new String[0][2];
Line 61... Line 63...
61
					}
63
					}
62
					
64
					
63
					r.rafraichir(util, true);
-
 
64
				}	
65
					r.rafraichir(util, true);
65
			});
-
 
66
			
66
				}