Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.FormPanel$SubmitCompleteEvent


  }
 
  @UiFactory FormPanel initFormPanel() {
    GWT.log("creating form panel");
    GWT.log("pre init uploadForm=" + uploadForm);
    FormPanel f = new FormPanel();
    f.setAction(GWT.getModuleBaseURL() + "uploadGPS");
    f.setEncoding(FormPanel.ENCODING_MULTIPART);
    f.setMethod(FormPanel.METHOD_POST);
    f.add(name);
    //f.add(description);
    f.add(fileUpload);
    f.add(submit);
    f.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {
      @Override
      public void onSubmitComplete(SubmitCompleteEvent event) {
       
        eventBus.fireEvent( new CloseWaitModelDialogEvent() );
       
View Full Code Here


        m_glassPanel.getElement().setId("login_glass_pane");

        SimplePanel dialog = new SimplePanel();
        dialog.getElement().setId("login_form_panel");

        m_fp = new FormPanel();
        m_fp.getElement().setId("login_form");
        dialog.setWidget(m_fp);

        String html =
            "<div id=\"loginHeaderContainer\">" +
View Full Code Here

    });
    finalGroup.add(submit);
    formBody.add(finalGroup);
    new OnEditEnabler(submit, yesIAgreeBox);

    final FormPanel form = new FormPanel();
    form.add(formBody);
    add(form);
  }
View Full Code Here

    } else {
      choices.add(new InlineHyperlink(Util.C.welcomeContinue(), nextToken));
    }
    formBody.add(choices);

    final FormPanel form = new FormPanel();
    form.add(formBody);
    add(form);
  }
View Full Code Here

    super(requestedMode, token);

    formBody = new FlowPanel();
    formBody.setStyleName(OpenIdResources.I.css().loginForm());

    form = new FormPanel();
    form.setMethod(FormPanel.METHOD_GET);
    form.addSubmitHandler(this);
    form.add(formBody);

    redirectBody = new FlowPanel();
    redirectBody.setVisible(false);
    redirectForm = new FormPanel();
    redirectForm.add(redirectBody);

    panelWidget = new FlowPanel();
    panelWidget.add(form);
    panelWidget.add(redirectForm);
View Full Code Here

  public MappingUpload(final LoginInfo loginInfo, String packageName, final DialogCallback callback)
  {
    this.callback = callback;

    form = new FormPanel();
    textPackage = new TextBox();
    textVersion = new TextBox();
    fileUpload = new FileUpload();
    vertPanel = new VerticalPanel();
View Full Code Here

        return horiz;
    }

    private Widget newImportWidget() {

        final FormPanel uploadFormPanel = new FormPanel();
        uploadFormPanel.setAction( GWT.getModuleBaseURL() + "backup" );
        uploadFormPanel.setEncoding( FormPanel.ENCODING_MULTIPART );
        uploadFormPanel.setMethod( FormPanel.METHOD_POST );

        HorizontalPanel panel = new HorizontalPanel();
        uploadFormPanel.setWidget( panel );

        final FileUpload upload = new FileUpload();
        upload.setHeight("30px");
        upload.setName( HTMLFileManagerFields.FILE_UPLOAD_FIELD_NAME_IMPORT );
        panel.add( upload );

        Button ok = new Button( constants.Import() );
        ok.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent sender) {
                doImportFile( uploadFormPanel );
            }

            private void doImportFile(final FormPanel uploadFormPanel) {
                if ( Window.confirm( constants.ImportConfirm() ) ) {
                    LoadingPopup.showMessage( constants.ImportingInProgress() );
                    uploadFormPanel.submit();
                }
            }
        } );

        panel.add(new HTML("&nbsp;&nbsp;&nbsp;"));

        panel.add( ok );

        uploadFormPanel.addSubmitCompleteHandler( new SubmitCompleteHandler() {

            public void onSubmitComplete(SubmitCompleteEvent event) {
                if ( event.getResults().indexOf( "OK" ) > -1 ) {
                    Window.alert( constants.ImportDone() );
                    History.newItem( " " );
                    Window.Location.reload();
                } else {
                    ErrorPopup.showMessage( constants.ImportFailed() );
                }
                LoadingPopup.close();
            }
        } );

        uploadFormPanel.addSubmitHandler( new SubmitHandler() {

            public void onSubmit(SubmitEvent event) {
                String fileName = upload.getFilename();
                if ( fileName.length() == 0 ) {
                    Window.alert( constants.NoExportFilename() );
View Full Code Here

  protected void performOperation() {
    MantleTabPanel contentTabPanel = SolutionBrowserPanel.getInstance().getContentTabPanel();
    contentTabPanel.showNewURLTab( this.tabName, this.tabToolTip, "about:blank", false ); //$NON-NLS-1$
    NamedFrame namedFrame = ( (IFrameTabPanel) contentTabPanel.getSelectedTab().getContent() ).getFrame();
    final FormPanel form = new FormPanel( namedFrame );
    RootPanel.get().add( form );
    form.setMethod( FormPanel.METHOD_POST );
    form.setAction( url );
    form.add( new Hidden( "reportXml", URL.encode( xml ) ) ); //$NON-NLS-1$
    form.submit();
    ( (IFrameTabPanel) contentTabPanel.getSelectedTab().getContent() ).setForm( form );
  }
View Full Code Here

   * @param repositoryFile
   */
  public ImportDialog( RepositoryFile repositoryFile ) {
    super( Messages.getString( "import" ), Messages.getString( "ok" ), Messages.getString( "cancel" ), false, true ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    form = new FormPanel();
    form.addSubmitHandler( new SubmitHandler() {
      @Override
      public void onSubmit( SubmitEvent se ) {
        // if no file is selected then do not proceed
        okButton.setEnabled( false );
View Full Code Here

public class FormPanelExample implements EntryPoint {

  public void onModuleLoad() {
    // Create a FormPanel and point it at a service.
    final FormPanel form = new FormPanel();
    form.setAction("/myFormHandler");

    // Because we're going to add a FileUpload widget, we'll need to set the
    // form to use the POST method, and multipart MIME encoding.
    form.setEncoding(FormPanel.ENCODING_MULTIPART);
    form.setMethod(FormPanel.METHOD_POST);

    // Create a panel to hold all of the form widgets.
    VerticalPanel panel = new VerticalPanel();
    form.setWidget(panel);

    // Create a TextBox, giving it a name so that it will be submitted.
    final TextBox tb = new TextBox();
    tb.setName("textBoxFormElement");
    panel.add(tb);

    // Create a ListBox, giving it a name and some values to be associated with
    // its options.
    ListBox lb = new ListBox();
    lb.setName("listBoxFormElement");
    lb.addItem("foo", "fooValue");
    lb.addItem("bar", "barValue");
    lb.addItem("baz", "bazValue");
    panel.add(lb);

    // Create a FileUpload widget.
    FileUpload upload = new FileUpload();
    upload.setName("uploadFormElement");
    panel.add(upload);

    // Add a 'submit' button.
    panel.add(new Button("Submit", new ClickHandler() {
      public void onClick(ClickEvent event) {
        form.submit();
      }
    }));

    // Add an event handler to the form.
    form.addSubmitHandler(new FormPanel.SubmitHandler() {
      public void onSubmit(SubmitEvent event) {
        // This event is fired just before the form is submitted. We can take
        // this opportunity to perform validation.
        if (tb.getText().length() == 0) {
          Window.alert("The text box must not be empty");
          event.cancel();
        }
      }
    });
    form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {
      public void onSubmitComplete(SubmitCompleteEvent event) {
        // When the form submission is successfully completed, this event is
        // fired. Assuming the service returned a response of type text/html,
        // we can get the result text here (see the FormPanel documentation for
        // further explanation).
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.FormPanel$SubmitCompleteEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.