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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:34:23+00:00 2026-06-18T23:34:23+00:00

I have created a custom widget in GWT like: public class Header extends Composite

  • 0

I have created a custom widget in GWT like:

public class Header extends Composite {
    private Button btnContribute;

    public Header() {
        btnContribute = new Button("Contribute");
    }
} //This is only a sample - in actual there are few bundled widgets

In my Entry point class I have used this custom widget as a north panel for my dockLayoutPanel as shown:

public class MyClass implements EntryPoint {
private DockLayoutPanel dockLayoutPanel;
private ScrollPanel contentScrollPanel;

private Header header; //My custom widget

public void onModuleLoad() {
    RootPanel rootPanel = RootPanel.get();

    dockLayoutPanel = new DockLayoutPanel(Unit.EM); 
    rootPanel.add(dockLayoutPanel, 20, 10);

    header = new Header();
    dockLayoutPanel.addNorth(header, 7.7);

    dockLayoutPanel.addSouth(new HTML("south"), 7.7);
    dockLayoutPanel.addWest(new HTML("west"), 7.7);

    contentScrollPanel = new ScrollPanel();
    dockLayoutPanel.add(contentScrollPanel);

    htmlContent = new HTML("content", true);
    contentScrollPanel.setWidget(htmlContent);
    htmlContent.setSize("100%", "100%");
}
}

I want to create a onClick event handler on the button in my custom widget ‘btnContribute’ such that it dynamically updates the ‘contentScrollPanel’, deletes the current content, and say loads a form in it.

The problem is that I when I try to create a event handler in my custom widget, I am unable to figure out as to how should I add and remove widgets from my entry point class..

  • 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-18T23:34:24+00:00Added an answer on June 18, 2026 at 11:34 pm

    Create getter in Header class ;

    In your Entrypoint class add the handler like below :

    header.getbtnContribute().addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                //TODO
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom widget in gwt which extends the composite.I am using
I have created a button widget with custom images by referring this article. I
I have created custom jQuery UI widget called uiPopover, very similar to UI-dialog (in
i have created a custom post type named Books & i have a widget
I have created a custom widget and I want to load an instance of
I have created a custom QDialog class and overridden the closeEvent to just hide
I have a speedometer widget I have created in my app using custom animation
I have a custom widget ( OrderItem ) in a GWT project. This widget
I have created a custom dijit widget which contains a grid and some buttons.
I have created a custom Magento module which extends the core sales order functionality

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.