Skip to content

Commit

Permalink
Not mandatory fields are required during changing account profile set…
Browse files Browse the repository at this point in the history
…tings
  • Loading branch information
vchizhevsky committed May 31, 2016
1 parent 17a7b6a commit 300612b
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -29,6 +29,8 @@

public class UserProfileViewImpl extends BaseDetailsViewImpl implements UserProfileView {

private static final String REQUIRED = Utils.avroUiStyle.requiredField();

private SizedTextBox authority;
private SizedTextBox firstName;
private SizedTextBox lastName;
Expand Down Expand Up @@ -69,6 +71,7 @@ protected void initDetailsTable() {
firstName.addInputHandler(this);

Label firstNameLabel = new Label(Utils.constants.firstName());
firstNameLabel.addStyleName(REQUIRED);
detailsTable.setWidget(1, 0, firstNameLabel);
detailsTable.setWidget(1, 1, firstName);

Expand All @@ -77,6 +80,7 @@ protected void initDetailsTable() {
lastName.addInputHandler(this);

Label lastNameLabel = new Label(Utils.constants.lastName());
lastNameLabel.addStyleName(REQUIRED);
detailsTable.setWidget(2, 0, lastNameLabel);
detailsTable.setWidget(2, 1, lastName);

Expand All @@ -85,7 +89,7 @@ protected void initDetailsTable() {
email.addInputHandler(this);

Label emailLabel = new Label(Utils.constants.email());
emailLabel.addStyleName(Utils.avroUiStyle.requiredField());
emailLabel.addStyleName(REQUIRED);
detailsTable.setWidget(3, 0, emailLabel);
detailsTable.setWidget(3, 1, email);

Expand All @@ -106,7 +110,10 @@ protected void resetImpl() {

@Override
protected boolean validate() {
return email.getValue().length()>0;
boolean result = firstName.getValue().length()>0;
result &= lastName.getValue().length()>0;
result &= Utils.validateEmail(email.getValue());
return result;
}

@Override
Expand Down

0 comments on commit 300612b

Please sign in to comment.