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
protected InfoBox infoBox;
protected InfoBox unsavedChangesInfoBox;
protected FormPanelWithSavePoint formPanel;
protected final int labelWidth;
......@@ -102,6 +100,8 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements
private Html loadingInfo;
protected Html unsavedChangesInfo;
protected LayoutContainer rightPanel;
private Button resetButton;
......@@ -125,10 +125,10 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements
setBorders(false);
setScrollMode(Scroll.AUTO);
setId(id);
add(unsavedChangesInfoBox = createUnsavedChangesInfoBox());
add(infoBox = createInfoBox());
add(loadingInfo = createLoadingInfo());
add(WidgetUtils.inRow(formPanel = createFormPanel(), rightPanel = createAdditionalPanel()));
add(unsavedChangesInfo = createUnsavedChangesInfo());
}
private LayoutContainer createAdditionalPanel()
......@@ -147,11 +147,13 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements
return result;
}
private InfoBox createUnsavedChangesInfoBox()
private Html createUnsavedChangesInfo()
{
InfoBox info = new InfoBox();
info.addStyleName("unsaved-changes-info");
return info;
Html result = new Html(messageProvider.getMessage(Dict.UNSAVED_FORM_CHANGES_INFO));
result.addStyleName("unsaved-changes-info");
result.setWidth(labelWidth + fieldWidth + PANEL_MARGIN);
result.setVisible(false);
return result;
}
private final static InfoBox createInfoBox()
......@@ -174,17 +176,12 @@ public abstract class AbstractRegistrationForm extends ContentPanel implements
protected void updateDirtyCheckAfterChange(boolean isDirty)
{
String saveMsg = messageProvider.getMessage(Dict.BUTTON_SAVE);
String unsavedChangesMsg = messageProvider.getMessage(Dict.UNSAVED_FORM_CHANGES_INFO);
if (isDirty)
{
saveButton.setText(saveMsg + "*");
unsavedChangesInfoBox.displayInfo(unsavedChangesMsg);
unsavedChangesInfo.setVisible(true);
} else
{
saveButton.setText(saveMsg);
unsavedChangesInfoBox.reset();
unsavedChangesInfo.setVisible(false);
}
}
......
......@@ -406,20 +406,4 @@ abstract public class AbstractGenericSampleRegisterEditForm extends
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 {
}
.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