Login Panel - how to do that

0 views
Skip to first unread message

waldek

unread,
Jun 9, 2007, 5:56:18 AM6/9/07
to GWT-Stuff
Can anybody provide any example how to use Login Panel widget ?

I tried doing like below, but I can not see any panel. Just nothing is
visible.


import org.mcarthur.sandy.gwt.login.client.LoginPanel;
import org.mcarthur.sandy.gwt.login.client.LoginPanel.LoginListener;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.RootPanel;

public class Foo implements EntryPoint
{
public void onModuleLoad()
{
VerticalPanel panel = new VerticalPanel();
Button btn = new Button("Show");

panel.add(btn);

btn.addClickListener(new ClickListener ()
{
public void onClick(Widget sender)
{
final LoginPanel login = new LoginPanel(new LoginListener()
{
public void onSubmit(LoginPanel loginPanel)
{
Window.alert("Submitted");
}
});

login.setErrorMessage("Error");
login.setSize("200px", "200px");
login.setVisible(true);
}
});

RootPanel.get().add(panel);
}
}

Sandy McArthur

unread,
Jun 9, 2007, 11:07:58 AM6/9/07
to gwt-...@googlegroups.com
The reason you don't see the login panel there is because you never
add it to the browser's document. Adding: RootPanel.get().add(login);
to your onClick method should at least show something.


--
Sandy McArthur

"He who dares not offend cannot be honest."
- Thomas Paine

Reply all
Reply to author
Forward
0 new messages