Example usage for com.google.gwt.user.client.ui FormPanel FormPanel

List of usage examples for com.google.gwt.user.client.ui FormPanel FormPanel

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui FormPanel FormPanel.

Prototype

protected FormPanel(Element element) 

Source Link

Document

This constructor may be used by subclasses to explicitly use an existing element.

Usage

From source file:cc.alcina.framework.gwt.client.util.ClientUtils.java

License:Apache License

public static void submitForm(Map<String, String> params, String url) {
    FormPanel p = new FormPanel("_self");
    p.setAction(url);/*  w  w w .j ava2 s . co m*/
    p.setMethod(FormPanel.METHOD_POST);
    FlowPanel fp = new FlowPanel();
    p.add(fp);
    for (String key : params.keySet()) {
        addHidden(fp, key, params.get(key));
    }
    RootPanel.get().add(p);
    p.submit();
    p.removeFromParent();
}

From source file:com.googlecode.mgwt.ui.client.widget.MSearchBox.java

License:Apache License

/**
 * Construct a search box with a given css
 * /*from  w  ww .  j a va 2  s  .co m*/
 * @param css the css to use
 */
public MSearchBox(MSearchBoxCss css) {
    this.css = css;
    this.css.ensureInjected();
    TouchPanel main = new TouchPanel();

    main.addStyleName(css.searchBox());

    initWidget(main);

    // search box needs this on ios
    roundDiv = new FormPanel("");
    roundDiv.addStyleName(css.round());
    main.add(roundDiv);

    roundDiv.addSubmitHandler(new SubmitHandler() {

        @Override
        public void onSubmit(SubmitEvent event) {
            event.cancel();

        }
    });

    box = new TextBox();
    box.addStyleName(css.input());

    // TODO
    box.getElement().setAttribute("autocapitalize", "off");
    box.getElement().setAttribute("autocorrect", "off");
    box.getElement().setAttribute("type", "search");

    roundDiv.add(box);

    clearButton = new ClearButton();

    clearButton.addStyleName(css.clear());

    setPlaceHolder("Search");

}

From source file:com.qualogy.qafe.mgwt.client.activities.searchbox.SearchBoxViewGwtImpl.java

License:Apache License

public SearchBoxViewGwtImpl() {

    FormPanel formPanel = new FormPanel("");
    formPanel.addSubmitHandler(new SubmitHandler() {

        @Override//from  www .  j a v  a2 s . com
        public void onSubmit(SubmitEvent event) {
            event.cancel();

        }
    });
    MSearchBox searchBox = new MSearchBox();
    formPanel.setWidget(searchBox);
    scrollPanel.setWidget(formPanel);
}

From source file:com.tasktop.c2c.server.profile.web.ui.client.view.components.account.authentication.AuthenticationView.java

License:Open Source License

public AuthenticationView() {
    createSshKeyTable();/*from w  w  w .  j  a v  a 2s . co  m*/
    // Give our Github form a target of "_self" - that will ensure that it replaces the current page when the
    // redirect to GitHub happens (which is what we want).
    githubForm = new FormPanel(new NamedFrame("_self"));
    initWidget(ourUiBinder.createAndBindUi(this));
    if (!AppGinjector.get.instance().getConfiguration().isEnablePasswordManagment()) {
        UIObject.setVisible(changePasswordDiv, false);
    }
    if (!AppGinjector.get.instance().getConfiguration().isEnableGitHubAuth()) {
        UIObject.setVisible(linkGitHubDiv, false);
    }
    associateGitHubAccountLabel
            .setHTML(profileMessages.gitHubAssociateAccount(commonProfileMessages.code2Cloud()));
}

From source file:com.tasktop.c2c.server.profile.web.ui.client.view.components.SignInView.java

License:Open Source License

private SignInView() {
    // Give our Github form a target of "_self" - that will ensure that it replaces the current page when the
    // redirect to GitHub happens (which is what we want).
    this.githubForm = new FormPanel(new NamedFrame("_self"));

    initWidget(uiBinder.createAndBindUi(this));
    hookDefaultButton(logonButton);//from  w  ww.j  ava2s  .  com
    TextBoxUtil.turnOffAutoCorrect(username);

    if (!AppGinjector.get.instance().getConfiguration().isEnableGitHubAuth()) {
        UIObject.setVisible(gitHubDiv, false);
    }

    gitHubSignInDescription
            .setHTML(profileMessages.gitHubSignInDescription(commonProfileMessages.code2Cloud()));
}

From source file:com.tasktop.c2c.server.profile.web.ui.client.view.components.SignUpViewImpl.java

License:Open Source License

private SignUpViewImpl() {
    // Give our Github form a target of "_self" - that will ensure that it replaces the current page when the
    // redirect to GitHub happens (which is what we want).
    this.githubForm = new FormPanel(new NamedFrame("_self"));
    initWidget(uiBinder.createAndBindUi(this));
    hookDefaultButton(createAccountButton);

    invitationOnlyLabel.setText(profileMessages.invitationOnly(commonProfileMessages.code2Cloud()));
    gitHubDetailsLabel.setHTML(profileMessages.gitHubDetailsContent(commonProfileMessages.code2Cloud()));
    nowCreateYourAccountLabel.setText(profileMessages.nowCreateYourAccount(commonProfileMessages.code2Cloud()));
    completeSignUpLabel.setText(profileMessages.completeSignUp(commonProfileMessages.code2Cloud()));
}

From source file:edu.stanford.bmir.protege.web.client.ui.projectmanager.ProjectRevisionBundleConverter.java

License:Open Source License

private void returnTObundle(String converted) {
    FormPanel form = new FormPanel("_blank");
    form.setAction("http://localhost:8080/BundleQueryInterface/BundleQuery.jsp");
    form.setMethod(FormPanel.METHOD_POST);
    Hidden onto = new Hidden("ontology", converted);
    form.add(onto);/* w ww.  j av a 2 s.com*/
    form.submit();
}

From source file:org.opencms.ui.client.login.CmsLoginTargetOpener.java

License:Open Source License

/**
 * Opens the login target for the given user name and password.<p>
 *
 * @param target the login target//from w w w.j a  va  2s  .c  o m
 * @param user the user
 * @param password the password
 */
public void openTarget(final String target, final String user, final String password) {

    // Post a hidden form with user name and password fields,
    // to hopefully trigger the browser's password manager
    final FormPanel form = new FormPanel("_self");
    Document doc = Document.get();
    InputElement userField = doc.createTextInputElement();
    userField.setName("ocUname");
    InputElement passwordField = doc.createPasswordInputElement();
    passwordField.setName("ocPword");
    userField.setValue(user);
    passwordField.setValue(password);
    form.getElement().appendChild(userField);
    form.getElement().appendChild(passwordField);
    form.setMethod("post");
    form.setAction(target);
    form.setVisible(false);
    add(form);
    form.submit();
}

From source file:org.pentaho.mantle.client.commands.ExecuteUrlInNewTabCommand.java

License:Open Source License

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);// w ww . j ava 2 s .  c  o  m
    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);
}

From source file:org.pentaho.mantle.client.commands.ExecuteWAQRPreviewCommand.java

License:Open Source License

protected void performOperation() {
    MantleTabPanel contentTabPanel = SolutionBrowserPerspective.getInstance().getContentTabPanel();
    contentTabPanel.showNewURLTab(Messages.getString("preview"), Messages.getString("adhocPreview"), //$NON-NLS-1$//$NON-NLS-2$
            "about:blank", false); //$NON-NLS-1$
    NamedFrame namedFrame = ((IFrameTabPanel) contentTabPanel.getSelectedTab().getContent()).getFrame();
    final FormPanel form = new FormPanel(namedFrame);
    RootPanel.get().add(form);/*w w w. j a v  a  2 s.  c  o m*/
    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);
}