Skip to content
Snippets Groups Projects
Commit f9d95fd9 authored by pkupczyk's avatar pkupczyk
Browse files

SP-104 / BIS-64 and SP-132 / BIS-82 - Registration and edit forms improvements:

- changed "You have unsaved changes." info position (moved it under the buttons)
- removed "*" from save buttons

SVN: 26209
parent 27e94ebe
No related branches found
No related tags found
No related merge requests found
...@@ -88,8 +88,6 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements ...@@ -88,8 +88,6 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements
protected InfoBox infoBox; protected InfoBox infoBox;
protected InfoBox unsavedChangesInfoBox;
protected FormPanelWithSavePoint formPanel; protected FormPanelWithSavePoint formPanel;
protected final int labelWidth; protected final int labelWidth;
...@@ -102,6 +100,8 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements ...@@ -102,6 +100,8 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements
private Html loadingInfo; private Html loadingInfo;
protected Html unsavedChangesInfo;
protected LayoutContainer rightPanel; protected LayoutContainer rightPanel;
private Button resetButton; private Button resetButton;
...@@ -125,10 +125,10 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements ...@@ -125,10 +125,10 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements
setBorders(false); setBorders(false);
setScrollMode(Scroll.AUTO); setScrollMode(Scroll.AUTO);
setId(id); setId(id);
add(unsavedChangesInfoBox = createUnsavedChangesInfoBox());
add(infoBox = createInfoBox()); add(infoBox = createInfoBox());
add(loadingInfo = createLoadingInfo()); add(loadingInfo = createLoadingInfo());
add(WidgetUtils.inRow(formPanel = createFormPanel(), rightPanel = createAdditionalPanel())); add(WidgetUtils.inRow(formPanel = createFormPanel(), rightPanel = createAdditionalPanel()));
add(unsavedChangesInfo = createUnsavedChangesInfo());
} }
private LayoutContainer createAdditionalPanel() private LayoutContainer createAdditionalPanel()
...@@ -147,11 +147,13 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements ...@@ -147,11 +147,13 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements
return result; return result;
} }
private InfoBox createUnsavedChangesInfoBox() private Html createUnsavedChangesInfo()
{ {
InfoBox info = new InfoBox(); Html result = new Html(messageProvider.getMessage(Dict.UNSAVED_FORM_CHANGES_INFO));
info.addStyleName("unsaved-changes-info"); result.addStyleName("unsaved-changes-info");
return info; result.setWidth(labelWidth + fieldWidth + PANEL_MARGIN);
result.setVisible(false);
return result;
} }
private final static InfoBox createInfoBox() private final static InfoBox createInfoBox()
...@@ -174,17 +176,12 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements ...@@ -174,17 +176,12 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements
protected void updateDirtyCheckAfterChange(boolean isDirty) protected void updateDirtyCheckAfterChange(boolean isDirty)
{ {
String saveMsg = messageProvider.getMessage(Dict.BUTTON_SAVE);
String unsavedChangesMsg = messageProvider.getMessage(Dict.UNSAVED_FORM_CHANGES_INFO);
if (isDirty) if (isDirty)
{ {
saveButton.setText(saveMsg + "*"); unsavedChangesInfo.setVisible(true);
unsavedChangesInfoBox.displayInfo(unsavedChangesMsg);
} else } else
{ {
saveButton.setText(saveMsg); unsavedChangesInfo.setVisible(false);
unsavedChangesInfoBox.reset();
} }
} }
......
...@@ -406,20 +406,4 @@ abstract public class AbstractGenericSampleRegisterEditForm extends ...@@ -406,20 +406,4 @@ abstract public class AbstractGenericSampleRegisterEditForm extends
return parentsArea.tryGetSamples(); return parentsArea.tryGetSamples();
} }
@Override
protected void updateDirtyCheckAfterChange(boolean isDirty)
{
super.updateDirtyCheckAfterChange(isDirty);
String saveUploadMsg = viewContext.getMessage(Dict.BUTTON_SAVE_AND_UPLOAD);
if (isDirty)
{
saveUploadButton.setText(saveUploadMsg + "*");
} else
{
saveUploadButton.setText(saveUploadMsg);
}
}
} }
...@@ -271,7 +271,8 @@ body,div,td,.default-text { ...@@ -271,7 +271,8 @@ body,div,td,.default-text {
} }
.unsaved-changes-info { .unsaved-changes-info {
margin-bottom: 5px; margin-right: 5px;
text-align: right;
} }
/***************************** /*****************************
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment