layout.setWidget(2, 1, emailTx);
layout.setWidget(3, 0, registerBt);
// Wrap the content in a DecoratorPanel
final DecoratorPanel decPanel = new DecoratorPanel();
decPanel.setWidget(layout);
RootPanel.get("register_content").add(decPanel);
final HTML hintMsg = new HTML();
RootPanel.get("register_content").add(hintMsg);
registerBt.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if (nicknameTx.getValue() != null && nicknameTx.getValue().trim().length() > 0 && emailTx.getValue() != null
&& emailTx.getValue().trim().length() > 0) {
contactsService.register(nicknameTx.getValue(), emailTx.getValue(), new AsyncCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {
// Window.Location.reload();
if (result) {
decPanel.setVisible(false);
hintMsg
.setHTML("<p><b><font color=\"blue\">Register Done, But It's NOT FINISHED!!! <br/> Until you get a confirm mail from this site.</font></b></p>");
} else {
decPanel.setVisible(true);
hintMsg.setHTML("<p><b><font color=\"red\">The email is duplicated. check again please.</font></b></p>");
}
}
@Override