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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:59:24+00:00 2026-05-30T01:59:24+00:00

In project I use MVP pattern. I have 2 view and 2 corresponding presenters.

  • 0

In project I use MVP pattern. I have 2 view and 2 corresponding presenters. From “Presenter2” i want to get selected value in “View1“. What is the best way to do it? I know that better to use event bus. But so i must to create 2 events and 2 event handlers (1st event will rise when Presenter2 need selected value from View1, and it will be handled in Presenter1. 2nd event will rise in Presenter1 (like: new selectedValueEvent(value) to notificate Presenter2 about selected value. So Presenter2 will handle selectedValueEvent(value) and get value).

  • 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-30T01:59:25+00:00Added an answer on May 30, 2026 at 1:59 am

    If the point when the presenter needs to get the selected value is when the user makes an action you won’t get around using an event. (Altough, maybe both presenters could react to the same event so don’t need to use two different ones?)

    If it is known when the presenter needs to get the value (a defined step in a workflow), you could to it like this:

    Keep a reference to the views in the ClientFactory:

    public class ClientFactoryImpl implements ClientFactory {
        private static final EventBus eventBus = new SimpleEventBus();
        /* The views */
        private static final SampleView sampleView = new SampleView(); 
        ....
    
        public ClientFactoryImpl(){
            eventBus.addHandler(ReleaseAddedEvent.type, sampleView);
            ....
        }
    
    
        // getter and setters
    }
    

    So in the Presenter you can get a reference to the view: SampleView view = MyEntryPoint.getClientFactory().getSampleView(); and then you can just call a method from the view which returns the selected value.

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

Sidebar

Related Questions

in my current project i use the MVP-Pattern and i want to register a
I have written a MVP project where the View is a WinForm that implements
We are trying to use the MVP pattern in our current project (asp.net app)
I have an ASP.NET 3.5 SP1 Webforms Application. I use the MVP pattern (supervising
In my project I use the Model-View-Presenter and want to create a UI-Element where
In my iPhone project,I use Odata Service to get data from SQL Server database
I'm working on an ASP.NET project using MVP architecture. We would like to use
I have converted an Entity framework project to use POCO objects by removing the
I have been looking into IKVMing Apache's FOP project to use with our .NET
I have developed on EXE project(use for startup task) and use following dlls of

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.