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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:59:25+00:00 2026-05-24T19:59:25+00:00

I created a a widget has a log in panel: Here is the code:

  • 0

I created a a widget has a log in panel:
Here is the code:

<!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>
        /* Add CSS here. See the GWT docs on UI Binder for more details */
    </ui:style>
        <g:VerticalPanel width="200px" height="auto">
            <g:Label text="Username:" width="100%" height="auto" />
            <g:TextBox ui:field="Username" width="100%" height="auto" />
            <g:Label text="Password:" width="100%" height="auto"/>
            <g:PasswordTextBox ui:field="Password" width="100%" height="auto" />
            <g:Cell horizontalAlignment="ALIGN_RIGHT">
                <g:Button text="Login" ui:field="button" height="25px"/>
            </g:Cell>
        </g:VerticalPanel>
</ui:UiBinder>

And here is the generated class:
public class LoginPanel extends Composite implements HasText {

    private static LoginPanelUiBinder uiBinder = GWT
            .create(LoginPanelUiBinder.class);

    interface LoginPanelUiBinder extends UiBinder<Widget, LoginPanel> {
    }

    public LoginPanel() {
        initWidget(uiBinder.createAndBindUi(this));
    }

    @UiField
    Button button;

    @UiField
    TextBox Username;

    @UiField
    PasswordTextBox Password;

    public LoginPanel(String firstName) {
        initWidget(uiBinder.createAndBindUi(this));
    }

    @UiHandler("button")
    void onClick(ClickEvent e) {
        Window.alert("Hello!");
    }

    public String getUsername() {
        return Username.getText();
    }

    public String getPassword() {
        return Password.getText();
    }

    @Override
    public String getText() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public void setText(String text) {
        // TODO Auto-generated method stub      
    }
}

I want to access the click event of this class on the onModuleLoad so that I can know when the user has clicked the button and has successfully logged in, so I can call other panels I created. Only thing this does is an alert.

This is the first time I’m playing with UiBinder, so I might be missing something.

Thank you.

  • 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-24T19:59:26+00:00Added an answer on May 24, 2026 at 7:59 pm

    So you want your LoginPanel to notify your main app class when a user has logged in?

    This is really a job for EventBus. Take a look at the exact use case that you need (AuthenticatedEvent): How to use the GWT EventBus

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

Sidebar

Related Questions

I created a widget that is a subclass of Composite and has a com.extjs.gxt.ui.client.widget.Viewport
The organization I work for has created a small flash widget that we're encouraging
I have created a custom widget which has a link to some ajax functionality.
I'm trying to create a form that has an expandable widget. The problem is
I created a widget that users of my site will embed on their web
I created a composite widget with webkit_webview widget stored in scrollwed window with a
I have created an App Widget for Android 1.5. It uses a TextView to
I've created a Vista sidebar widget that uses jQuery to fetch XML and display
Actually I created a button using the cobogw widget library. But the button does
How can I in code of the custom Qt widget know that it is

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.