Subversion Repository Public Repository

litesoft

Diff Revisions 534 vs 535 for /trunk/GWT_Sandbox/Upload/src/org/litesoft/sandbox/csapp/client/widgets/UploadWidget.java

Diff revisions: vs.
  @@ -13,6 +13,8 @@
13 13
14 14 public Widget createWaitingMessageWidget( Widget secondsRemaining );
15 15
16 + public void requestingUpload( String filename );
17 +
16 18 public void timeout( String filename );
17 19
18 20 public void parseResponse( String fileName, String pHtmlResponse );
  @@ -25,11 +27,13 @@
25 27 private final SimplePanel viewPort = createViewPort( createFormFloater( formPanel ) );
26 28 private final ButtonBase illusionaryClickWidget;
27 29 private final Widget sizingWidget;
28 - private boolean externallyEnabled;
29 30
30 31 private final int secondsToWait;
31 32 private final Callback callback;
32 33
34 + private boolean externallyEnabled;
35 + private String lastSubmittedFileName;
36 +
33 37 private String servletPath;
34 38 private Timer timer;
35 39 private boolean sized = false;
  @@ -110,7 +114,7 @@
110 114 if ( filename != null )
111 115 {
112 116 stopTimer();
113 - submitForm( filename );
117 + submitForm( lastSubmittedFileName = filename );
114 118 }
115 119 }
116 120 }).scheduleRepeating( 250 );
  @@ -155,6 +159,7 @@
155 159 Window.alert( "No Servlet Path Set" );
156 160 return;
157 161 }
162 + callback.requestingUpload( filename );
158 163 formPanel.setAction( servletPath );
159 164 formPanel.submit();
160 165 enableWidgets( false );
  @@ -164,17 +169,15 @@
164 169 private void timeout()
165 170 {
166 171 hideBusy();
167 - String filename = upload.getFilename();
168 172 resetUploadWidget();
169 - callback.timeout( filename );
173 + callback.timeout( lastSubmittedFileName );
170 174 }
171 175
172 176 private void submitResponse( String htmlResponse )
173 177 {
174 178 hideBusy();
175 - String filename = upload.getFilename();
176 179 resetUploadWidget();
177 - callback.parseResponse( filename, htmlResponse );
180 + callback.parseResponse( lastSubmittedFileName, htmlResponse );
178 181 }
179 182
180 183 private static Widget createConstrainer( Widget widget )