| Line 12... |
Line 12... |
| 12 |
import com.google.gwt.http.client.Response;
|
12 |
import com.google.gwt.http.client.Response;
|
| 13 |
import com.google.gwt.http.client.URL;
|
13 |
import com.google.gwt.http.client.URL;
|
| 14 |
import com.google.gwt.json.client.JSONParser;
|
14 |
import com.google.gwt.json.client.JSONParser;
|
| 15 |
import com.google.gwt.json.client.JSONString;
|
15 |
import com.google.gwt.json.client.JSONString;
|
| 16 |
import com.google.gwt.json.client.JSONValue;
|
16 |
import com.google.gwt.json.client.JSONValue;
|
| 17 |
import com.google.gwt.user.client.HTTPRequest;
|
- |
|
| 18 |
import com.google.gwt.user.client.ResponseTextHandler;
|
17 |
import com.google.gwt.user.client.ResponseTextHandler;
|
| 19 |
import com.google.gwt.user.client.Window;
|
18 |
import com.google.gwt.user.client.Window;
|
| Line 20... |
Line 19... |
| 20 |
|
19 |
|
| 21 |
/**
|
20 |
/**
|
| Line 85... |
Line 84... |
| 85 |
Response response) {
|
84 |
Response response) {
|
| Line 86... |
Line 85... |
| 86 |
|
85 |
|
| Line 87... |
Line 86... |
| 87 |
final JSONValue responseValue = JSONParser.parse(response.getText());
|
86 |
final JSONValue responseValue = JSONParser.parse(response.getText());
|
| 88 |
|
87 |
|
| 89 |
// si la requete se passe bien on reçoit un tableau JSON
|
88 |
// si la requete se passe bien on reçoit un tableau JSON
|
| 90 |
if(responseValue.isArray() != null)
|
89 |
if(responseValue.isString() != null)
|
| 91 |
{
|
- |
|
| 92 |
// qui contient une valeur : le nombre d'images correspondant au critères
|
90 |
{
|
| 93 |
JSONValue res = responseValue.isArray().get(0) ;
|
91 |
// qui contient une valeur : le nombre d'images correspondant au critères
|
| 94 |
JSONString reponseNombre = res.isString() ;
|
92 |
JSONString res = responseValue.isString() ;
|
| - |
|
93 |
int maxObservations = Integer.parseInt(res.stringValue()) ;
|
| 95 |
int maxObservations = Integer.parseInt(reponseNombre.stringValue()) ;
|
94 |
int[] nbObservations = {maxObservations} ;
|
| 96 |
int[] nbObservations = {maxObservations} ;
|
95 |
|
| 97 |
// on le met dans un tableau d'entiers qu'on tranmset au demandeur de la mise à jour
|
96 |
// on le met dans un tableau d'entiers qu'on tranmset au demandeur de la mise à jour
|
| Line 98... |
Line 97... |
| 98 |
r.rafraichir(nbObservations, true) ;
|
97 |
r.rafraichir(nbObservations, true) ;
|