losing focus on the page when popup comes

37 views
Skip to first unread message

sreenivas

unread,
Jan 2, 2013, 9:50:03 AM1/2/13
to google-we...@googlegroups.com
Hi,

I want to make my complete page to loose focus when popup comes. I mean i should not be able to click any widgets in the background when popup appears. For now, I am able to get the pop up , but I am able to click the buttons in the background page. How should i achieve this blur mechanism on background when popup opens?

Andy King

unread,
Jan 2, 2013, 10:30:13 AM1/2/13
to google-we...@googlegroups.com
Is this for something like a login screen?  I've done this by creating a widget ... the UiBinder XML file is as follows (this is in LoginWidget.ui.xml):

<ui:UiBinder
  xmlns:ui='urn:ui:com.google.gwt.uibinder'
  xmlns:g='urn:import:com.google.gwt.user.client.ui'>
  <g:FlowPanel>
    <g:Label>Login is required</g:Label>
    <g:TextBox ui:field='userIdTextBox'>User ID</g:TextBox>
    <g:PasswordTextBox ui:field='passwordTextBox'>Password</g:PasswordTextBox>
    <g:Button ui:field='okButton'>OK</g:Button>
  </g:FlowPanel>
</ui:UiBinder>

In the Java source file (LoginWidget.java) I create the UiBinder object in the LoginWidget constructor using:

ILoginWidgetBinder = GWT.create(ILoginWidgetBinder.class);
setWidget(binder.createAndBindUi(this));

When I want to display the login request screen I call the "login()" method:

public void login() {
  setGlassEnabled(true);
  show();
  center();
}

When the "OK" button is clicked and a response received from the server to the login credentials the "onSuccess()" method executes the "hide()" method to hide the login widget.
Reply all
Reply to author
Forward
0 new messages