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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:57:09+00:00 2026-06-09T16:57:09+00:00

I have implemented MVP pattern in my GXT project. The system registers customers as

  • 0

I have implemented MVP pattern in my GXT project. The system registers customers as part of it function. Also the system user can search for the registered user providing the id.

i have added an OnClick event to the “search customer” button.

/* On click search button */
        view.getBtnSearch().addListener(Events.OnClick, new Listener<BaseEvent>() {
            @Override
            public void handleEvent(BaseEvent be) {
                eventBus.fireEvent(new CustomerRegistrationTabSelectionEvent(0, false));
                eventBus.fireEvent(new CustomerFetchEvent(view.getValueCustSearchParameter(), view.getValueCustSearchValue(), true));
            }
        });

The CustomerRegistrationTabSelectionEvent does select the relevant tab and enables other tabs. Thats all it does.

Here is the handler for the custom event CustomerFetchEvent.

eventBus.addHandler(CustomerFetchEvent.TYPE, new CustomerFetchEventHandler() {
            @Override
            public void fetchCustomer(CustomerFetchEvent event) {
                searchCustomer(event.getParameter(), event.getParameterValue(), event.isOpenFirstTab()); 
            }
        });

The issue is the search customer method is executed multiple times and if there is a invalid search the error message dialog shows multiple popups. Within the searchCustomer method i call for service which fetch me the customer data or show the popup error message if the search is invalid.

im using GXT 2.2.5 and JRE 1.6.

Could anyone help me in finding out why the code is executed multiple times?

Added Later:
When i run the application first time the code is only executed only once, therefore only 1 popup. Then i logout of the system and log in again (navigating to the same page where the “search customer” button exists.) and the code is executed twice. Likewise equal to the number of times i create/navigate to the particular page, the code executes. Is it actually adding the event handler code without removing the last one every time i recreate the page?

  • 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-06-09T16:57:11+00:00Added an answer on June 9, 2026 at 4:57 pm

    Ya. I fixed it!Here is the solution Unbinding presenters necessary in GWT

    U can read more here. http://draconianoverlord.com/2010/11/23/gwt-handlers.html

    what happened actually was, the presenter objects where i have registered with HandlerManager to receive events were not garbage collected. Because though i remove the reference to the presenters still the HandlerManager holds a reference to those objects. So every time i kept on creating new presenters on top of the old presenters of the same class. so a event is listened by multiple objects of the same class. so u need to ensure that the unused presenters are garbage collected by removing the registered handlers
    in HandlerManager.

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

Sidebar

Related Questions

I have implemented the MVP pattern in a few WinForms applications that uses a
I am developing a large-ish application in WPF/WCF/NHibernate/etc. and have implemented the MVP pattern
I have a MVP application implemented. Back button is working fine. I'd like to
I have implemented a table view with multiple threads. Currently when a user taps
I have implemented a UISearchDisplayController that allows users to search a table. Currently the
I am thinking about implementing a user interface according to the MVP pattern using
Have you ever seen someone try to implement the MVP pattern with ASP.NET Web
I'm working with GWT 2.4 and MVP pattern, so I have Presenters and Views
I have implemented language localization to an Android application. My questions are: I can't
in a classic Passive-MVP pattern, how can i avoid a reference of the presenter

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.