| Line 10... |
Line 10... |
| 10 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
10 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
| 11 |
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
|
11 |
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
|
| 12 |
import com.extjs.gxt.ui.client.widget.Html;
|
12 |
import com.extjs.gxt.ui.client.widget.Html;
|
| 13 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
13 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
| 14 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
14 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
| - |
|
15 |
import com.google.gwt.core.client.Callback;
|
| 15 |
import com.google.gwt.event.dom.client.ClickEvent;
|
16 |
import com.google.gwt.event.dom.client.ClickEvent;
|
| 16 |
import com.google.gwt.event.dom.client.ClickHandler;
|
17 |
import com.google.gwt.event.dom.client.ClickHandler;
|
| - |
|
18 |
import com.google.gwt.json.client.JSONParser;
|
| - |
|
19 |
import com.google.gwt.json.client.JSONValue;
|
| 17 |
import com.google.gwt.user.client.ui.Button;
|
20 |
import com.google.gwt.user.client.ui.Button;
|
| 18 |
import com.google.gwt.user.client.ui.FileUpload;
|
21 |
import com.google.gwt.user.client.ui.FileUpload;
|
| 19 |
import com.google.gwt.user.client.ui.FormPanel;
|
22 |
import com.google.gwt.user.client.ui.FormPanel;
|
| 20 |
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent;
|
23 |
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent;
|
| 21 |
import com.google.gwt.user.client.ui.FormPanel.SubmitEvent;
|
24 |
import com.google.gwt.user.client.ui.FormPanel.SubmitEvent;
|
| Line 70... |
Line 73... |
| 70 |
});
|
73 |
});
|
| Line 71... |
Line 74... |
| 71 |
|
74 |
|
| 72 |
form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {
|
75 |
form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {
|
| 73 |
@Override
|
76 |
@Override
|
| - |
|
77 |
public void onSubmitComplete(SubmitCompleteEvent event) {
|
| - |
|
78 |
String resultat = event.getResults();
|
| - |
|
79 |
// Le formulaire est envoyé à travers un iframe caché, ce qui pose problème
|
| - |
|
80 |
// à certains navigateurs pour lire le retour
|
| - |
|
81 |
// si rien n'est renvoyé, on demande les stats d'upload au service par une autre requête
|
| - |
|
82 |
if(resultat == null || resultat.isEmpty()) {
|
| - |
|
83 |
PublicationAsyncDao.demanderStatistiquesDernierImport(new Callback<JSONValue, String>() {
|
| - |
|
84 |
|
| - |
|
85 |
@Override
|
| 74 |
public void onSubmitComplete(SubmitCompleteEvent event) {
|
86 |
public void onSuccess(JSONValue result) {
|
| - |
|
87 |
surFormulaireEnvoye(result);
|
| - |
|
88 |
}
|
| - |
|
89 |
|
| - |
|
90 |
@Override
|
| - |
|
91 |
public void onFailure(String reason) {
|
| - |
|
92 |
// TODO Auto-generated method stub
|
| - |
|
93 |
}
|
| - |
|
94 |
});
|
| - |
|
95 |
} else {
|
| - |
|
96 |
JSONValue responseValue = JSONParser.parseStrict(resultat);
|
| - |
|
97 |
surFormulaireEnvoye(responseValue);
|
| 75 |
surFormulaireEnvoye(event);
|
98 |
}
|
| 76 |
}
|
99 |
}
|
| Line 77... |
Line 100... |
| 77 |
});
|
100 |
});
|
| Line 82... |
Line 105... |
| 82 |
add(form);
|
105 |
add(form);
|
| 83 |
add(boutonsPanel);
|
106 |
add(boutonsPanel);
|
| 84 |
}
|
107 |
}
|
| Line 85... |
Line 108... |
| 85 |
|
108 |
|
| 86 |
public abstract void surSoumissionFormulaire(SubmitEvent event);
|
109 |
public abstract void surSoumissionFormulaire(SubmitEvent event);
|
| 87 |
public abstract void surFormulaireEnvoye(SubmitCompleteEvent event);
|
110 |
public abstract void surFormulaireEnvoye(JSONValue reponse);
|
| 88 |
public abstract void surClicAnnuler();
|
111 |
public abstract void surClicAnnuler();
|