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 6959761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:18:53+00:00 2026-05-27T15:18:53+00:00

I have a GWT 2.4 app using MVP, clientFactory, activities, places, and uiBinder. I

  • 0

I have a GWT 2.4 app using MVP, clientFactory, activities, places, and uiBinder. I have a composite widget that I created as a standalone object with it’s own ui.xml file. I reference that class and insert it into the main viewImpl.ui.xml file.

The composite widget receives some data from the backend and I need to get it back to the activity so it can be displayed in a table. I’m using the presenter that is associated with the view to get to the activity. Here is the code:
In the View interface:

public interface NameView extends IsWidget
{
    void setPresenter(Presenter presenter);
...    

public interface Presenter{
            void goTo(Place place);
            void setRowDataList(List<Data> rowData);
        }

In my Activity I implement the View.Presenter as in:

 Activity extends AbstractActivity implements NameView.Presenter

so the activity is the presenter I need from within my standalone widget and in the start method for the activity I use:

NameView  nameView = clientFactory.getNameView();//NameView is just an example.
nameView.setPresenter(this); ...

to setup the presenter and instantiate it. My problem is, in the widget I need this:

presenter.setRowDataList(rowData);

but I’m not sure how to reference the instantiated Presenter from the widget?

This separate widget, actually a gwtUpload widget, is standalone. I do a server side calculation on some data that is uploaded and that is what is returned back to this widget.

The widget data needs to get back to the Activity in order to pass that data back to the NameViewImpl class.

I thought the presenter was the proper way to do that, but since the widget isn’t wired to the view or viewImpl I need a way to get that presenter for the widget.

I know GIN would do it with DI or maybe I create another presenter. I’ve never setup GIN with GWT. Any ideas as to the correct way to do this?

Working Implementation:

I don’t know if this is the best implementation or not, but based on the answer from Thomas, I set my widget with the instance of the presenter(activity) in the setPresenter() method in the ViewImpl class. It works as a pass-through for the widget to return back to the activity. I assume that is what Thomas meant as a callback interface.

  • 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-27T15:18:53+00:00Added an answer on May 27, 2026 at 3:18 pm

    What we did in similar situations is to define a callback interface for the widget (similar to the presenter interface in your presenter-view pair), and then we generally make the presenter interface extend that widget-specific interface.
    Then, when we call setPresenter (or whatever it’s called) on the view, to associated the presenter, the view immediately calls setCallback on the widget with the same value (the presenter implements the callback interface).

    An alternative design is to hide the widget-specific callback behind a method of your presenter interface. Let the view implement the callback, implementing the method such that it’s routed to the equivalent method of the presenter.

    BTW, GIN won’t help here.

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

Sidebar

Related Questions

I have a GWT App and I am using GWT MVP with Places /
I have a GWT app that makes an RPC call to a server to
We have a GWT app that has multiple screens, based off of a menu.
I have a GWT app that I ported to GWT 2.4. Now I geta
I have a newly coded GWT/GAE app that uses RequestFactory and Editors on the
I have a GWT app and I'm using RequestBuilder get GET some json from
I've made an app init function that I'm using both in Java and GWT
I have a GWT 2.3 web app using Objectdb via Rpc. In the embedded
I have problems running my GWT app in debug mode using maven 3. Hosted
I have a common GWT application that is using (trying to) Rocket-Framework to implement

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.