Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 607445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:21:39+00:00 2026-05-13T17:21:39+00:00

If I am using the MVP pattern with GWT, as in the GWT architecture

  • 0

If I am using the MVP pattern with GWT, as in the GWT architecture best practices talk from Google I/O from 2009, but have spread out the information into multiple widgets, how should the value object be populated?

Say I have a EditPersonView/Presenter, a EditPetView/Presenter and an EditAddressView/Presenter and the last two are widgets as a part of a panel in the EditPersonView. With these I have the following class:

class PersonDetails {
    private PetDetails pet;
    private AddressDetails addressDetails;

    // ...
}

The PetDetails and AddressDetails instance variables are managed in their presenter counterparts. When the user clicks the “Save” button in the EditPersonView, how should the communication between the widgets be done so that the PersonDetails is filled with information from its child widgets?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:21:39+00:00Added an answer on May 13, 2026 at 5:21 pm

    I’ve faced this same problem in a few different GWT applications that I’ve designed using Ray Ryan’s approach.
    My preferred solution is to create a Singleton “session object” that stores the state of that part of the application. In your example, it might look like this:

    interface EditPersonSession {
    
        void fetchPerson(PersonId id);
        PersonDetails getCurrentPersonDetails();
        void updatePersonDetail(PersonDetail<?> detail);
        void updatePetDetail(PetDetail<?> detail);
        void updateAddressDetail(AddressDetail<?> detail);
        void save();
    
    }
    

    All three presenters contain a reference to the session object (perhaps injected by Gin). Whenever the UI (view) is manipulated by the user, the presenter associated with that view immediately pushes the state to the shared session object. For example, inside EditAddressPresenter:

    view.getStreetNameTextBox().addValueChangeHandler(new ValueChangeHandler() {
    
        void onValueChange(ValueChangeEvent<String> event) {
            editPersonSession.updateAddressDetail(new StreetNameAddressDetail(event.getValue()));
        }
    
    }
    

    When it is time to save, the state object is told to save the state to the server. At this point, the session object has up-to-date representations of the data, and can save it all at once. So, in EditPersonPresenter:

    view.getSaveButton().addClickHandler(new ClickHandler() {
    
        void onClick(ClickEvent event) {
            editPersonSession.save();
        }
    
    }
    

    This way, the presenters need not contain any references to each other, but can send consistent information to the server.
    If the presenters need to know when information that they display has been updated (either by other presenters, or by the server), the session object can notify them by firing events on the event bus (shared Singleton HandlerManager). The presenters can then pull the most current PersonDetails from the session object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using GWT with the MVP pattern , I'd like to have a place that
I've been using MVP pattern in my application. But I have problems with testing
I am using the MVP design pattern and I have registered my presenter as
I have been playing around with the MVP pattern using winforms for the last
Background Story: I am developing a GWT application, using the standard MVP design pattern,
I have a GWT App and I am using GWT MVP with Places /
I'm using MVP pattern, so I have a View that has almost no logic
I'm using GWT 2.4 with the MVP pattern, with uiBinder, and a widget: GwtUploader.
I'm trying to implement an MVP pattern using STL and I have used *shared_ptr*
We're using the MVP pattern and GWT and I'm wondering how and when dependency

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.