Example usage for com.google.gwt.gwtpages.client.message PageRequestSessionWithMessage PageRequestSessionWithMessage

List of usage examples for com.google.gwt.gwtpages.client.message PageRequestSessionWithMessage PageRequestSessionWithMessage

Introduction

In this page you can find the example usage for com.google.gwt.gwtpages.client.message PageRequestSessionWithMessage PageRequestSessionWithMessage.

Prototype

public PageRequestSessionWithMessage(String successMessage) 

Source Link

Usage

From source file:com.google.gwt.gwtpages.demo.client.pages.NavigationPage.java

/**
 * NOTE: this requires the use of {@link DefaultPageMessageHandler} or some
 * other message event handler. This handler is automatically added when
 * calling {@link GWTPagesSettings#addDefaultEventHandlers()}
 *//*from  w ww  .jav a  2 s . c  o m*/
private void onNavigationWithSuccessMessage() {
    PageRequestSession session = new PageRequestSessionWithMessage("This is a success message");
    pages.goTo(PageConstants.PAGE_REQUEST_INFO, session).addParameter("param1", "bar").execute();
}

From source file:hudson.gwtmarketplace.client.pages.product.EditProductPage.java

License:Open Source License

public void onSave() {
    ArrayList<Message> messages = new ArrayList<Message>();
    WidgetUtil.checkNull(new LabeledContainer[] { name, category, status, license, webpageUrl }, messages);
    if (isNull(description.getText())) {
        messages.add(Message.error("Please enter the description", description));
    }/*from w  ww  .j av a2 s .c o m*/
    if (messages.size() > 0) {
        Messages.get().setMessages(null, messages);
        return;
    }

    product.setDescription(description.getHTML());
    if (null == product.getId())
        product.setName(name.getComponent().getValue());
    List<String> _tags = tags.getValues();
    if (null != _tags && _tags.size() > 0) {
        product.setTags(_tags.toArray(new String[_tags.size()]));
    } else {
        product.setTags(null);
    }
    product.setOrganizationName(organization.getValue());
    product.setVersionNumber(versionNumber.getComponent().getValue());
    product.setStatus(status.getValue(status.getSelectedIndex()));
    product.setLicense(license.getValue(license.getSelectedIndex()));
    product.setCategoryId(WidgetUtil.getSelectedValue(category.getComponent()));
    product.setWebsiteUrl(webpageUrl.getValue());
    product.setDownloadUrl(downloadUrl.getValue());
    product.setWikiUrl(wikiUrl.getValue());
    product.setDemoUrl(showcaseUrl.getValue());
    product.setIssueTrackerUrl(issueTrackerUrl.getValue());
    product.setForumUrl(forumUrl.getValue());
    product.setNewsUrl(newsfeedUrl.getValue());
    new SaveProductCommand(product) {
        @Override
        public void onSuccess(Product result) {
            pages.goTo(result.getAlias(), new PageRequestSessionWithMessage("The product details were saved."))
                    .execute();
        }
    }.execute();
}