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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:39:42+00:00 2026-06-15T21:39:42+00:00

In GWT, I have a FormPanel with several textfields. These fields have ChangeEvent handlers,

  • 0

In GWT, I have a FormPanel with several textfields. These fields have ChangeEvent handlers, but the thing is these handlers must perform implementation specific. They must also work using UiBinder’s @UiHandler.

There are two classes that implement this formpanel and more may come in the future. I need this form to be in one place because it will change per deployment environment of the application.

So what I want, is to override my handlers per implementation. Currently what I thought of, was to pass the class that implements the form instance through the constructor, then call methods declared in that implementing class from the textfields’ handlers, but then I’d also want to in some way force declaration of such a method in the implementing class.

I currently can’t think of how I should go about doing this, I may really be missing something here. What would be the best way to do this?

Brief example

FormPanelX

TabThatContainsFPX
PopupThatContainsFPX

The tab and popup both contain the formpanel, but the actionhandlers on the fields must perform slightly different in each case.

  • 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-15T21:39:43+00:00Added an answer on June 15, 2026 at 9:39 pm

    Why must they work using UiBinder’s @UiHandler? You don’t have to attach handlers in that fashion.

    I’m guessing you have a composite that looks something like this.

    public class FormPanelX extends Composite {
    
    private static FormPanelXUiBinder uiBinder = GWT
            .create(FormPanelXUiBinder.class);
    
    interface FormPanelXUiBinder extends UiBinder<Widget, FormPanelX> {
    }
    
    public FormPanelX() {
        initWidget(uiBinder.createAndBindUi(this));
    }
    
    @UiField
    FormPanel formPanel;
    
    @UiField
    TextBox textField;
    
    private HandlerRegistration handlerRegistration;
    
    public FormPanelX(String firstName) {
        initWidget(uiBinder.createAndBindUi(this));
    }
    
    public TextBox getTextField() {
        return textField;
    }
    
    public void setTextField(TextBox textField) {
        this.textField = textField;
    }   
    }
    

    The easiest way is to probably have a get method for the text field so you can attach change handlers directly to it.

    Then in your TabThatContainsFPX or PopupThatContainsFPX, you could do something like..

    FormPanelX form = new FormPanelX();
    form.getTextField().addChangeHandler(new ChangeHandler(){
    
            @Override
            public void onChange(ChangeEvent event) {
                //Implementation specific to TabThatContainsFPX
    
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multiselect ListBox in a FormPanel in GWT. I have set the
I have gwt web project, which must use application.properties (on client side) loaded as
I have a gwt application which I need to apply custom themes for specific
I have a GWT-FormPanel on my website, where people can upload pictures and answer
While working on a site, I want to have several modules in my GWT
In GWT I have class MyClass that registers some event handlers. There is an
I have a FormPanel in GWT that should send a TextBox input to a
I have a simple GWT application that consists of a FormPanel that contains a
In my gwt application I have a FormPanel and inside it there is a
Does gwt have (good) support for effects, moving around elements, and resizing them? Are

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.