final TextField username = new TextField("Username");
username.focus();
fields.addComponent(username);
final PasswordField password = new PasswordField("Password");
fields.addComponent(password);
//TODO: Borrar
password.setValue("root");
username.setValue("admin@tesis.com");
final Button signin = new Button("Sign In");
signin.addStyleName("default");
fields.addComponent(signin);
fields.setComponentAlignment(signin, Alignment.BOTTOM_LEFT);
final ShortcutListener enter = new ShortcutListener("Sign In",
KeyCode.ENTER, null) {
/**
*
*/
private static final long serialVersionUID = -2425923923914266067L;
@Override
public void handleAction(Object sender, Object target) {
signin.click();
}
};
signin.addClickListener(new ClickListener() {
/**
*
*/
private static final long serialVersionUID = 8646342267124075364L;
@Override
public void buttonClick(ClickEvent event) {
if (username.getValue() != null
&& password.getValue() != null
)
idUsuario = Usuario.Login(username.getValue(),password.getValue());
if (idUsuario != null){
signin.removeShortcutListener(enter);
buildMainView();
} else {