title: GXT File Upload not calling servlet
body: <p>I'm using this class:</p>
  
  <pre><code>/**
   * 
   */
  package com.xerox.tclg.ejuror.ui.client;
  import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
  import com.extjs.gxt.ui.client.event.ButtonEvent;
  import com.extjs.gxt.ui.client.event.Events;
  import com.extjs.gxt.ui.client.event.FormEvent;
  import com.extjs.gxt.ui.client.event.Listener;
  import com.extjs.gxt.ui.client.event.SelectionListener;
  import com.extjs.gxt.ui.client.widget.LayoutContainer;
  import com.extjs.gxt.ui.client.widget.MessageBox;
  import com.extjs.gxt.ui.client.widget.button.Button;
  import com.extjs.gxt.ui.client.widget.button.ButtonBar;
  import com.extjs.gxt.ui.client.widget.form.FileUploadField;
  import com.extjs.gxt.ui.client.widget.form.FormPanel;
  import com.extjs.gxt.ui.client.widget.form.FormPanel.Encoding;
  import com.extjs.gxt.ui.client.widget.form.FormPanel.Method;
  import com.extjs.gxt.ui.client.widget.form.LabelField;
  import com.extjs.gxt.ui.client.widget.form.TextField;
  import com.extjs.gxt.ui.client.widget.layout.TableData;
  import com.extjs.gxt.ui.client.widget.layout.TableLayout;
  import com.google.gwt.core.client.GWT;
  import com.google.gwt.user.client.rpc.AsyncCallback;
  import com.google.gwt.user.client.ui.Image;
  import com.xerox.tclg.ejuror.ui.client.service.PersonViewService;
  import com.xerox.tclg.ejuror.ui.client.service.PersonViewServiceAsync;
  import com.xerox.tclg.ejuror.ui.client.workbench.StyleHelper;
  
  /**
   * Form for uploading images to the main server
   * @author Xerox Services
   */
  public class UploadForm extends MessageEnabledContainer {
    //instance variables
    private String                  description;
    private String                  cancel;
    private String                  file;
    private MessageResource         messageResource;
    private String                  ok;
    private PersonViewServiceAsync  personViewService = (PersonViewServiceAsync) GWT.create(PersonViewService.class);
  
    //UI components
    private Button                  btnOk;
    private Button                  btnCancel;
    private ButtonBar               buttonBar;
    private LabelField              lblTitle;
    private FormPanel               form;
    private LayoutContainer         header;
    private LayoutContainer         layMain;
    private TextField&lt;String&gt;       textDescription;
    private FileUploadField         uploadFile;
  
      /**
     * Create a disclaimer page that will show disclaimers and return the results in a callback
       * @param icon
       * @param header1
       * @param header2
       * @param disclaimerText
       * @param buttonFlags
       */
      public UploadForm() {
      String    selectFile;
      String    title;
      messageResource = ImageViewer.getImageViewer();
      if(isDesignTime()){
        cancel = "Cancel";
        description = "Short Description&lt;BR/&gt;(e.g. Doctor's Letter)";
        file = "File";
        ok = "Ok";
        selectFile = "Select a File to Upload";
        title = "Upload a File";
      }
      else{
        cancel = messageResource.getString(Messages.MSGKEY_CANCEL);
        description = "Short Description&lt;BR/&gt;(e.g. Doctor's Letter)";
        file = "File";
        ok = messageResource.getString(Messages.MSGKEY_OK);
        selectFile = "Select a File to Upload";
        title = "Upload a File";
      }
  
      addStyleName("white-screen");
      setWidth(MainLayout.FORM_WIDTH);  
          setLayout(new TableLayout());
  
          header = new LayoutContainer();
          TableLayout tl_header = new TableLayout(2);
          tl_header.setCellSpacing(5);
          header.setLayout(tl_header);
  
      Image imageUpload = new Image(EjurorBundle.BUNDLE.uploadIcon());
      header.add(imageUpload);
  
      String str = StyleHelper.formatHeader(title);
      lblTitle = new LabelField(str);
      header.add(lblTitle);
  
      layMain = new LayoutContainer();
      TableLayout tl_layMain = new TableLayout();
      tl_layMain.setCellPadding(5);
      layMain.setLayout(tl_layMain);
  
      layMain.add(header);
  
      form = new FormPanel();
      form.setHeading(selectFile);  
      layMain.add(form);
  
      buildUploadForm();
  
      buildButtonBar();
  
      FooterContainer footer = new FooterContainer("50");
      TableData td_footer = new TableData();
      td_footer.setWidth("100%");
      layMain.add(footer, td_footer);
      footer.setSize("740", "");
  
      add(layMain);
  
      loadUrl();
      }
  
    /**
     * 
     */
    private void buildButtonBar() {
  //    buttonBar = new ButtonBar();
  //    buttonBar.setAlignment(HorizontalAlignment.RIGHT);
  //    buttonBar.setHeight(MainLayout.BUTTON_BAR_HEIGHT);
  //    form.add(buttonBar);
  
      btnOk = new Button(ok);
      btnOk.setSize(MainLayout.BUTTON_WIDTH, MainLayout.BUTTON_HEIGHT);
      btnOk.addSelectionListener(new SelectionListener&lt;ButtonEvent&gt;() {
        @Override
        public void componentSelected(ButtonEvent be) {
          if(form.isValid()){
            upload();
          }
          else{
            MessageBox.info("Validation Error", "You must enter all required fields.", null);
          }
        }
      });
  //    buttonBar.add(btnOk);
      form.add(btnOk);
  
      btnCancel = new Button(cancel);
      btnCancel.setSize(MainLayout.BUTTON_WIDTH, MainLayout.BUTTON_HEIGHT);
      btnCancel.addSelectionListener(new SelectionListener&lt;ButtonEvent&gt;() {
        @Override
        public void componentSelected(ButtonEvent be) {
          exit();
        }
      });
  //    buttonBar.add(btnCancel);
      form.add(btnCancel);
      }
  
    /**
     * 
     */
    private void buildUploadForm() {
      form.setFrame(true);  
      form.setEncoding(Encoding.MULTIPART);  
      form.setMethod(Method.POST);  
      form.setButtonAlign(HorizontalAlignment.CENTER);  
      form.setWidth(MainLayout.CONTENT_WIDTH);  
      form.addListener(Events.Submit, new Listener&lt;FormEvent&gt;() {
        public void handleEvent(FormEvent fe) {
          System.out.println(fe.getResultHtml());
        };
      });  
  
      String desc = StyleHelper.formatPrompt(description);
      textDescription = new TextField&lt;String&gt;();
      textDescription.setAllowBlank(false);
      textDescription.setFieldLabel(desc);
      form.add(textDescription);
  
      String fileLabel = StyleHelper.formatPrompt(file);
  
      uploadFile = new FileUploadField();
      uploadFile.setAllowBlank(false);
      uploadFile.setFieldLabel(fileLabel);
      form.add(uploadFile);
    }
  
    /**
     * Jump back to the landing page
     */
    protected void exit(){
      ImageViewer.getImageViewer().showLanding();
    }
  
    /**
     * 
     */
    protected void upload(){
      form.submit();
      exit();
    }
  
    /**
     * Load the URL from the person service
     */
    private void loadUrl() {
      personViewService.buildUploadUrl(new AsyncCallback&lt;String&gt;() {
  
        @Override
        public void onFailure(Throwable caught) {
          System.err.println("Unable to construct URL");
          caught.printStackTrace();
          MainLayout.showError(caught.getMessage());
        }
  
        @Override
        public void onSuccess(String url) {
          form.setAction(url);
        }
      });
    }
  
    /**
     * GWT-Designer will change to return true during design time
     * 
     * @return
     */
    private static final boolean isDesignTime() {
      return false;
    }
  }
  </code></pre>
  
  <p>As you can see the URL is built dynamically.</p>
  
  <p>The problem is that when I run this, and click the OK button, the servlet never gets called. If I look at the rendered HTML and copy the URL that in the action, and then paste that into my browser, it calls the servlet, so the URL is OK.</p>
  
  <p>I have also verified that submit is being called.</p>
  
  <p>Can anyone point me in the right direction? I'm following this example:</p>
  
  <p><a href="http://extjs-public.googlecode.com/svn/gxt/release/samples/examples/www/com.extjs.gxt.samples.Examples/forms/fileupload.html" rel="nofollow">http://extjs-public.googlecode.com/svn/gxt/release/samples/examples/www/com.extjs.gxt.samples.Examples/forms/fileupload.html</a></p>