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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:55:56+00:00 2026-05-20T23:55:56+00:00

For testing purposes, I want to use a DialogBox for logging into my application.

  • 0

For testing purposes, I want to use a DialogBox for logging into my application.

Here’s the uibinder file:

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
  xmlns:g="urn:import:com.google.gwt.user.client.ui">
  <ui:style>
  </ui:style>
    <g:HTMLPanel>
      <g:Label>Username</g:Label>
      <g:TextBox ui:field="username"></g:TextBox>
      <g:Label>Password</g:Label>
      <g:PasswordTextBox ui:field="password"></g:PasswordTextBox>
      <g:Button ui:field="login">Login</g:Button>
    </g:HTMLPanel>
</ui:UiBinder>

And here’s my implementation of it:

public class Login extends DialogBox {
    private static LoginUiBinder uiBinder = GWT.create(LoginUiBinder.class);

    interface LoginUiBinder extends UiBinder<Widget, Login> {}

    @UiField
    TextBox username;
    @UiField
    PasswordTextBox password;
    @UiField
    Button login;

    public Login() {
        setHTML("Login");
        setWidget(uiBinder.createAndBindUi(this));
    }
}

Now my question is: Is this the correct way to do it? The documentation doesn’t seem to say anything on how to do this sort of thing…

  • 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-20T23:55:57+00:00Added an answer on May 20, 2026 at 11:55 pm

    That’s what I do, and it’s been working great in production for months. It’s super easy to understand and reuse.

    I made an abstract dialog with the same pattern that has an abstract method onConfirm and a built-in confirm button. I also include in the UiBinder a panel to accept a widget, and override the setWidget function to put the widget into that interior panel. Then, whenever I need a new dialog for something, I can just write:

    final CustomWidget whicheverWidgetINeedRightNow = xyz;
    CustomDialog dialog = new CustomDialog()
    {
        @Override
        protected void onConfirm()
        {
            process(whicheverWidgetINeedRightNow.getData());
        }
    };
    dialog.setWidget(whicheverWidgetINeedRightNow);
    

    The ok button in the template UiBinder is hard-wired to call onConfirm when it’s pressed. Nifty! For more complex cases, I’d subclass CustomDialog in its own named class.

    It’s worked well for me in maybe 5 or 6 different situations in my app, and I don’t have to re-style or re-code anything.

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

Sidebar

Related Questions

For testing purposes I want send mail to my localhost user account rather than
For testing purposes I have to generate a file of a certain size (to
For testing purposes, I want to replace the implementation of a few methods of
For testing purposes, I placed two databases on the same server, I want to
I'd like to use the System.Diagnostics.Trace class to perform simple tracing of my application
I want to set up a private Cloud for testing purposes, the problem is,
http://msdn.microsoft.com/en-us/library/bfsktky3%28v=VS.100%29.aspx states that the makecert tool is for testing purposes only. I realize you
for testing purposes i need an recursive directory with some files, that comes to
For testing purposes I need to get my Outlook 2003 addin (vb.net) disabled so
For testing purposes, is there some place in the Visual Studio IDE where you

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.