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

  • Home
  • SEARCH
  • 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 6549589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:06:40+00:00 2026-05-25T12:06:40+00:00

I had wrote a test composite + entry point which are just to show

  • 0

I had wrote a test composite + entry point which are just to show my test DialogBox.
The structure is…

  • A) EntryPoint contains Composite
  • B) Composite contains Button (in ScrollPanel) to show A class
  • C) A class extends DialogBox

event listener code like a…

button.addClickHandler(new ClickHandler() { public void
onClick(ClickEvent event) {
DialogBox aDialog=new A();
aDialog.center(); aDialog.show(); } });

No doalogBox ever shown 🙁 What am I doing wrong?

Any useful comment is appreciated

  • 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-25T12:06:41+00:00Added an answer on May 25, 2026 at 12:06 pm

    First try adding Window.alert("Handler called!"); in your Button’s clickHandler to see the handler actually is being called. If you see a javascript alert dialog(handler is called) that means the problem is in your CustomDialogBox. Make sure you set the content of your dialog box by setWidget(Widget w) BEFORE you call show() to make it visible otherwise it won’t show.

    If no alert(handler is never called) that means the problem lies within your composite. It can be an issue of adding some of the elements directly to DOM without using widgets, it would break the gwt even mechanism(would explain why it works when you add button to root panel). Other than that, it is hard to tell without seeing some code.

    Lastly I will post some working code in case you decide to work your way up from this to see where it fails. Here is a code that works :

    First Extend DialogBox (dont forget to set its widget) :

    public class CustomDialog extends DialogBox {
        public CustomDialog() {
            setWidget(new Label("Hello!"));
        }
    }
    

    Then build a composite :

    public CustomComposite() {
        Button b = new Button("Pop it up");
        b.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                new CustomDialog().show();
            }
        });
        initWidget(b);
    }
    

    finally onModuleLoad :

    public void onModuleLoad() {
        CustomComposite c = new CustomComposite();
        RootPanel.get().add(c);
    }
    

    BTW : center() does center the pop up and then show()s, so you don’t need to call both

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

Sidebar

Related Questions

I recently wrote a class for an assignment in which I had to store
I wrote a test program for testing Cassandra, and I had problems reading data.
I wrote this ISAPI filter to rewrite the URL because we had some sites
I recently wrote a program that used a simple producer/consumer pattern. It initially had
For this assignment I had to create my own string class. I initially wrote
back in school, we wrote a compiler where curly braces had the default behavior
I'm sorry for opening a new question, I had to - as I wrote
Have had to write my first proper multithreaded coded recently, and realised just how
I've just had to write a string reverse function in C# 2.0 (i.e. LINQ
I recently had this problem on a test: given a set of points m

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.