Bonjour,
J'ai le message d'erreur:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 
[ERROR] Uncaught exception escaped
java.lang.IllegalStateException: Should only call onAttach when the widget is detached from the browser's document
	at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:105)
	at com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:165)
	at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:111)
	at com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:165)
	at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:111)
	at com.google.gwt.user.client.ui.DecoratedPopupPanel.doAttachChildren(DecoratedPopupPanel.java:167)
	at com.google.gwt.user.client.ui.DialogBox.doAttachChildren(DialogBox.java:191)
	at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:111)
	at com.google.gwt.user.client.ui.Widget.setParent(Widget.java:231)
	at com.google.gwt.user.client.ui.Panel.adopt(Panel.java:119)
	at com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:86)
	at com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java:80)
	at com.google.gwt.user.client.ui.PopupPanel$ResizeAnimation.onInstantaneousRun(PopupPanel.java:234)
	at com.google.gwt.user.client.ui.PopupPanel$ResizeAnimation.setState(PopupPanel.java:166)
	at com.google.gwt.user.client.ui.PopupPanel.show(PopupPanel.java:690)
	at com.google.gwt.user.client.ui.PopupPanel.center(PopupPanel.java:344)
	at webpage.client.Localiser.<init>(Localiser.java:86)
	at webpage.client.GeoLocFGE$3.execute(GeoLocFGE.java:61)
	at com.google.gwt.user.client.CommandExecutor.doExecuteCommands(CommandExecutor.java:311)
	at com.google.gwt.user.client.CommandExecutor$2.run(CommandExecutor.java:206)
	at com.google.gwt.user.client.Timer.fireImpl(Timer.java:164)
	at com.google.gwt.user.client.Timer.fireAndCatch(Timer.java:150)
	at com.google.gwt.user.client.Timer.fire(Timer.java:142)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
	at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:126)
	at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
	at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
	at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
	at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
	at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:720)
	at com.google.gwt.dev.GWTShell.run(GWTShell.java:593)
	at com.google.gwt.dev.GWTShell.main(GWTShell.java:357)
Cela arrive qd je relance une fenetre (une dialogBox), je la lance comme suit:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
 
	cmdLocaliserVehicule=new Command(){
			public void execute(){
				new Localiser(GeoLocFGE.this);
			}
		};
Le code de la DialogBox Localiser:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
 
package webpage.client;
 
import java.util.Collections;
import java.util.Date;
import java.util.ArrayList;
 
import com.google.gwt.maps.client.MapWidget;
 
import com.google.gwt.maps.client.control.MapTypeControl;
import com.google.gwt.maps.client.control.SmallMapControl;
 
import com.google.gwt.maps.client.geom.LatLng;
 
import com.google.gwt.user.client.Window;
 
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
 
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
 
import com.gwtext.client.data.SimpleStore;
import com.gwtext.client.data.Record;
 
import com.gwtext.client.widgets.DatePicker;
import com.gwtext.client.widgets.MessageBox;
 
import com.gwtext.client.widgets.event.DatePickerListenerAdapter;
 
import com.gwtext.client.widgets.form.ComboBox;
import com.gwtext.client.widgets.form.DateField;
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
 
public class Localiser 	extends DialogBox 
			implements ClickListener {
//Position et dimension
	private final 	int 	windowWidth=1000;
	private final 	int 	windowHeight=667;
	private final 	int 	buttonWidth=100;
	private final 	int 	buttonHeight=30;
	private final 	int 	buttonHori=windowWidth-buttonWidth-5;
	private 	int 	buttonTop=5;
	private	int	cbTop=buttonTop+buttonHeight+1;
	private final 	int 	mapWidth=windowWidth-buttonWidth-15;
	private final 	int 	mapHeight=windowHeight-10;
 
//Composants graphiques
	private AbsolutePanel	lConteneur=null;
	private MapWidget 	carte=null;
	private Button 		buttonClose=null;
	private ComboBox 		cbVehicule=null;
	private Label		lbVehicule=null;
	private DateField		dfDateDebut=null;
	private Label		lbDateDebut=null;
	private DateField		dfDateFin=null;
	private Label		lbDateFin=null;
	private Button 		btLocaliser=null;
	private Button 		btInit=null;
 
//Variables de "gestion"
	private		GeoLocRemoteServiceAsync	service=null;
	private		ServiceDefTarget 	endpoint=null;
	protected	SimpleStore	stCBVehicule=null;
	protected	Object[][]  list=null;
	protected	long	dateDebut=-1;
	protected	long	dateFin=-1;
	protected	int	idVehicule=-1;
	protected	ArrayList<GeoLocMarker> 	listPoint=null;
	protected	String 	queryPosition=null;
	protected 	String 	queryDemArr=null;
	protected 	ArrayList<ArrayList<String>>	listTotale=null;
 
	/** Constructeur */
	public Localiser(GeoLocFGE connexion){
		super(false,true);
		service=connexion.getService();
		endpoint=connexion.getEndpoint();
		this.init();
		this.recupVehi();
		this.center();
	}
	/**Initialisation */
	private void init() {
		this.setText("Localiser un véhicule");
		this.setPixelSize(windowWidth, windowHeight);
		this.setWidget(this.getLConteneur());
	}
	/** conteneur de la fenêtre*/
	private AbsolutePanel getLConteneur() {
		if(lConteneur==null){
			lConteneur=new AbsolutePanel();
			lConteneur.setPixelSize(windowWidth, windowHeight);
			lConteneur.add(this.getCarte(), 5, 5);
			lConteneur.add(this.getButtonClose(),buttonHori,windowHeight-buttonHeight-5);
			lConteneur.add(this.getLBVehicule(), buttonHori, buttonTop);
			buttonTop=cbTop+buttonHeight+1;
			lConteneur.add(this.getLBDateDebut(), buttonHori, buttonTop);
			buttonTop=buttonTop+buttonHeight+1;
			lConteneur.add(this.getDFDateDebut(),buttonHori,buttonTop);
			buttonTop=buttonTop+buttonHeight+1;
			lConteneur.add(this.getLBDateFin(), buttonHori, buttonTop);
			buttonTop=buttonTop+buttonHeight+1;
			lConteneur.add(this.getDFDateFin(),buttonHori,buttonTop);
			buttonTop=buttonTop+buttonHeight+1;
			lConteneur.add(this.getBTLocaliser(), buttonHori, buttonTop);
			buttonTop=buttonTop+buttonHeight+1;
			lConteneur.add(this.getBTInit(), buttonHori, buttonTop);
 
			this.getDFDateDebut().addListener(new DatePickerListenerAdapter(){
				public void onSelect(DatePicker dataPicker, Date date) {
					dateDebut=date.getTime();
				}
			});
			this.getDFDateFin().addListener(new DatePickerListenerAdapter(){
				public void onSelect(DatePicker dataPicker, Date date) {
					dateFin=date.getTime();
				}
			});
		}
		return lConteneur;
	}
	private Button getBTInit() {
		if(btInit==null){
			btInit=new Button("Init",this);
			btLocaliser.setPixelSize(buttonWidth, buttonHeight);
		}
		return btInit;
	}
	private Button getBTLocaliser() {
		if(btLocaliser==null){
			btLocaliser=new Button("Localiser",this);
			btLocaliser.setPixelSize(buttonWidth, buttonHeight);
		}
		return btLocaliser;
	}
	private Label getLBDateFin() {
		if(lbDateFin==null){
			lbDateFin=new Label("Fin");
			lbDateFin.setPixelSize(buttonWidth, buttonHeight);
			lbDateFin.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		}
		return lbDateFin;
	}
	private DateField getDFDateFin() {
		if(dfDateFin==null){
			dfDateFin=new DateField();
			dfDateFin.setPixelSize(buttonWidth, buttonHeight);
			dfDateFin.setFormat("j/m/Y");
			dfDateFin.setTabIndex(31);
			dfDateFin.setReadOnly(true);
		}
		return dfDateFin;
	}
	private Label getLBDateDebut() {
		if(lbDateDebut==null){
			lbDateDebut=new Label("Début");
			lbDateDebut.setPixelSize(buttonWidth, buttonHeight);
			lbDateDebut.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		}
		return lbDateDebut;
	}
	private DateField getDFDateDebut() {
		if(dfDateDebut==null){
			dfDateDebut=new DateField();
			dfDateDebut.setPixelSize(buttonWidth, buttonHeight);
			dfDateDebut.setFormat("j/m/Y");
			dfDateDebut.setTabIndex(31);
			dfDateDebut.setReadOnly(true);
		}
		return dfDateDebut;
	}
	private Label getLBVehicule() {
		if(lbVehicule==null){
			lbVehicule=new Label("Véhicules");
			lbVehicule.setPixelSize(buttonWidth, buttonHeight);
			lbVehicule.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		}
		return lbVehicule;
	}
	private ComboBox getCBVehicule() {
		if(cbVehicule==null){
			cbVehicule=new ComboBox();
			cbVehicule.setPixelSize(buttonWidth, buttonHeight);
			cbVehicule.setForceSelection(true);
			cbVehicule.setStore(stCBVehicule);
			cbVehicule.setFieldLabel("Véhicules");
			cbVehicule.setDisplayField("vehicules");
			cbVehicule.setValueField("id");
			cbVehicule.setMode(ComboBox.LOCAL); 
			cbVehicule.setSelectOnFocus(true);
		}
		return cbVehicule;
	}
 
	private Button getButtonClose() {
		if(buttonClose==null){
			buttonClose=new Button("Fermer",this);
			buttonClose.setPixelSize(buttonWidth, buttonHeight);
		}
		return buttonClose;
	}
	private MapWidget getCarte(){
		if(carte==null){
			carte=new MapWidget();
			carte.setPixelSize(mapWidth, mapHeight);
			carte.setZoomLevel(10);
			carte.setCenter(LatLng.newInstance(43.5398,1.5181));
			carte.addControl(new SmallMapControl());
			carte.addControl(new MapTypeControl());
			carte.setScrollWheelZoomEnabled(true);
		}
		return carte;
	}
 
//FONCTION OUTILS
	private void recupVehi(){
		String query="select * from vehicule;";
		service.getSelectBDD(query, new AsyncCallback<SelectBDD>(){
			public void onFailure(Throwable caught) {
				Window.alert(caught.getMessage());
			}
			public void onSuccess(SelectBDD result) {
				ArrayList<ArrayList<String>> arrayList=result.getList();
				int nbLigne=arrayList.size();
				int tailleLigne=arrayList.get(0).size();
				list= new Object[nbLigne][tailleLigne];
				for(int i=0;i<nbLigne;i++){
					for(int j=0;j<tailleLigne;j++){
						list[i][j]=arrayList.get(i).get(j);
					}
				}
				stCBVehicule=new SimpleStore(new String[]{"id","vehicules"}, list);
 
				getLConteneur().add(getCBVehicule(),buttonHori,cbTop);
				getCBVehicule().addListener(new ComboBoxListenerAdapter(){
					public void onSelect(ComboBox comboBox, Record record, int index){
						idVehicule=Integer.parseInt(getCBVehicule().getValue());
					}
				});
				stCBVehicule.load();
			}
		});
	}
	private void localiserVehicule() {
		//pas de date de fin saisie
		if(dateFin==-1){
			//table position
			queryPosition="select position.* from position,vehiculeboitier" +
			" where position.idx_numboitier=vehiculeboitier.idx_numboitier" +
			" and vehiculeboitier.idx_vehicule='"+idVehicule+
			"' and vehiculeboitier.dateservice<='"+dateDebut+
			"' and position.dateheure>='"+dateDebut+"';";
			//table demarr
			queryDemArr="select demarr.* from demarr,vehiculeboitier" +
			" where demarr.idx_numboitier=vehiculeboitier.idx_numboitier" +
			" and vehiculeboitier.idx_vehicule='"+idVehicule+
			"' and vehiculeboitier.dateservice<='"+dateDebut+
			"' and demarr.dateheure>='"+dateDebut+"';";
		//pas de date de debut saisie
		}else if (dateDebut==-1){
			//table position
			queryPosition="select position.* from position,vehiculeboitier" +
			" where position.idx_numboitier=vehiculeboitier.idx_numboitier" +
			" and vehiculeboitier.idx_vehicule='"+idVehicule+
			"' and vehiculeboitier.dateservice<='"+dateFin+
			"' and position.dateheure<='"+dateFin+"';";
			//table demarr
			queryDemArr="select demarr.* from demarr,vehiculeboitier" +
			" where demarr.idx_numboitier=vehiculeboitier.idx_numboitier" +
			" and vehiculeboitier.idx_vehicule='"+idVehicule+
			"' and vehiculeboitier.dateservice<='"+dateFin+
			"' and demarr.dateheure<='"+dateFin+"';";
		//les 2 dates saisies
		}else {
			//table position
			queryPosition="select position.* from position,vehiculeboitier" +
			" where position.idx_numboitier=vehiculeboitier.idx_numboitier" +
			" and vehiculeboitier.idx_vehicule='"+idVehicule+
			"' and vehiculeboitier.dateservice<='"+dateFin+
			"' and position.dateheure>='"+dateDebut+
			"' and position.dateheure<='"+dateFin+"';";
			//table demarr
			queryDemArr="select demarr.* from demarr,vehiculeboitier" +
			" where demarr.idx_numboitier=vehiculeboitier.idx_numboitier" +
			" and vehiculeboitier.idx_vehicule='"+idVehicule+
//			"' and vehiculeboitier.dateservice>='"+dateDebut+
			"' and vehiculeboitier.dateservice<='"+dateFin+
			"' and demarr.dateheure>='"+dateDebut+
			"' and demarr.dateheure<='"+dateFin+"';";
		}
		//recuperation des positions
		listTotale=new ArrayList<ArrayList<String>>();
		service.getSelectBDD(queryPosition, new AsyncCallback<SelectBDD>(){
			public void onFailure(Throwable caught) {
				Window.alert(caught.getMessage());
			}
			public void onSuccess(SelectBDD result) {
				listTotale.addAll(result.getList());
				service.getSelectBDD(queryDemArr, new AsyncCallback<SelectBDD>(){
					public void onFailure(Throwable caught) {
						Window.alert(caught.getMessage());
					}
					public void onSuccess(SelectBDD result) {
						listTotale.addAll(result.getList());
						if(!listTotale.isEmpty()){
							chargerMarker(listTotale);
							int pSize=listPoint.size();
							for(int p=0;p<pSize;p++){
								carte.addOverlay(listPoint.get(p).getMarque());
							}
							if(!listPoint.isEmpty()){
								carte.setCenter(listPoint.get(0).getMarque().getLatLng());
							}
						}
					}
				});
			}
		});
	}
	/** chargement des marker dans listPoint et triage decroissont sur le champs dateheure*/
	protected void chargerMarker(ArrayList<ArrayList<String>> list){
		listPoint=new ArrayList<GeoLocMarker>();
		for(int i=0;i<list.size();i++){
			listPoint.add(new GeoLocMarker(list.get(i),this));	
		}
		Collections.sort(listPoint);
	}
 
//LISTENER	
	public void onClick(Widget sender) {
		if(sender.getClass()==Button.class){
			//Click sur bouton Fermer
			if(sender.equals(this.getButtonClose())){
				Localiser.this.hide();
			//Click sur bouton Localiser
			}else if(sender.equals(this.getBTLocaliser())){
				if(idVehicule!=-1){
					if((dateDebut==-1)&&(dateFin==-1)){
						MessageBox.alert("Localiser un véhicule.", "Aucune date sélectionnée, localisation impossible.");
					}else {
						this.localiserVehicule();
					}
				}else{
					MessageBox.alert("Localiser un véhicule.", "Aucun véhicule sélectionné, localisation impossible.");
				}
			//Click sur bouton init
			}else if(sender.equals(this.getBTInit())){
				this.getDFDateDebut().reset();
				this.getDFDateFin().reset();
				this.getCBVehicule().reset();
				this.getCarte().clearOverlays();
			}
		}
	}
}
Apperement, l'erreur intervien quand je fais le "this.center()" (c'est pareil avec un show())... mais je dois avouer que je comprend pas d'où ça viens...
Si quelqu'un à une idée je suis preneur... comme d'hab
Merci d'avance!