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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:36:13+00:00 2026-06-12T17:36:13+00:00

I was required to put a Done button in a GWT Composite (despite already

  • 0

I was required to put a “Done” button in a GWT Composite (despite already having the close icon), it should simply close the window upon clicking. Unfortunately, I can’t find a .close() method to implement it. How can it be done?

enter image description here

I have a UserDialog class that contains a Composite component, which I named UserComposite. UserDialog extends to CustomDialogBox, which extends to DialogBox class:

public class UserDialog extends CustomDialogBox {    
    private UserComposite c = new UserComposite();
    // more codes here
    private FlowPanel getFlowPanel() {
        if (p instanceof Panel && c instanceof Composite) {
            p.setSize(WIDTH, HEIGHT);
            p.add(c);
        }
        return p;
    } 
}

and then this is my UserComposite

public class UserComposite extends Composite {
   // codes here
   @UiHandler("doneButton")
   void onDoneButtonClick(ClickEvent event) {
      this.removeFromParent();
   }
}

I tried removeFromParent() but the UserComposite was only removed from parent which resulted to an empty DialogBox.

enter image description here

  • 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-12T17:36:14+00:00Added an answer on June 12, 2026 at 5:36 pm

    You need to hide the dialog, not the composite. One way to do this is to pass a reference to the dialog box to the UserComposite constructor, and then use that reference to call hide() on the dialog. It could be something along these lines:

    public class UserDialog extends CustomDialogBox {
        private UserComposite c = new UserComposite(this);
        ...
    }
    
    public class UserComposite extends Composite {
        private DialogBox parentDialog;
    
        public UserComposite(DialogBox parentDialog) {
            this.parentDialog = parentDialog;
        }
    
        @UiHandler("doneButton")
        void onDoneButtonClick(ClickEvent event) {
            parentDialog.hide();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get my required xml elements in block.But at the same, i also put
Where should I put require_once statements, and why? Always on the beginning of a
I have seen and done initialization of arrays and all put nil at the
I have any array with value 0,0,0,0,0,0,0,0,1,1,1 Now my required output should be like
required( dependency-expression ) They give an example of required: #other:checked but I want my
Advice required on architecting module I have a PORT Listener that listens to a
Code required to append list (anotherList) to item (id -= l1) of second list
I am required to write a C++ application to run on an embedded Linux
We use @Constraint.Required to validate the fields of our forms, and this generates a
// No overrides required .. let CLR take care of equal and hashcode. Class

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.