Skip to content
Snippets Groups Projects
Commit 5a1fc91e authored by felmer's avatar felmer
Browse files

SP-298, BIS-210: some bug in GUI code fixed.

SVN: 26990
parent d1b3622b
No related branches found
No related tags found
No related merge requests found
......@@ -41,14 +41,14 @@ public class ManagedPropertyFormHelper
private final FormPanel formPanel;
private final Map<String, TextField<?>> inputFieldsByLabel;
private final Map<String, TextField<?>> inputFieldsByCode;
public ManagedPropertyFormHelper(IViewContext<?> viewContext, FormPanel formPanel,
Map<String, TextField<?>> inputFieldsByLabel)
Map<String, TextField<?>> inputFieldsByCode)
{
this.viewContext = viewContext;
this.formPanel = formPanel;
this.inputFieldsByLabel = inputFieldsByLabel;
this.inputFieldsByCode = inputFieldsByCode;
}
......@@ -88,7 +88,7 @@ public class ManagedPropertyFormHelper
}
FieldUtil.setMandatoryFlag(field, inputDescription.isMandatory());
inputFieldsByLabel.put(label, field);
inputFieldsByCode.put(inputDescription.getCode(), field);
formPanel.add(field);
}
......
......@@ -60,7 +60,7 @@ public final class ManagedPropertyGridActionDialog extends
private final IManagedUiTableAction managedAction;
private final Map<String, TextField<?>> inputFieldsByLabel =
private final Map<String, TextField<?>> inputFieldsByCode =
new LinkedHashMap<String, TextField<?>>();
private final ManagedPropertyFormHelper formHelper;
......@@ -77,7 +77,7 @@ public final class ManagedPropertyGridActionDialog extends
this.callback = callback;
this.managedAction = managedAction;
setWidth(400);
formHelper = new ManagedPropertyFormHelper(viewContext, formPanel, inputFieldsByLabel)
formHelper = new ManagedPropertyFormHelper(viewContext, formPanel, inputFieldsByCode)
{
@Override
protected void trySetBoundedValue(IManagedInputWidgetDescription inputDescription)
......@@ -112,7 +112,7 @@ public final class ManagedPropertyGridActionDialog extends
for (IManagedInputWidgetDescription inputDescription : managedAction
.getInputWidgetDescriptions())
{
TextField<?> field = inputFieldsByLabel.get(inputDescription.getLabel());
TextField<?> field = inputFieldsByCode.get(inputDescription.getCode());
Object fieldValue = field.getValue();
String value = fieldValue == null ? null : field.getValue().toString().trim();
if (fieldValue instanceof SimpleComboValue)
......@@ -147,12 +147,12 @@ public final class ManagedPropertyGridActionDialog extends
&& data.size() == 1)
{
String boundedColumnTitleOrNull =
managedAction.getBindings().get(inputDescription.getLabel());
managedAction.getBindings().get(inputDescription.getCode());
if (boundedColumnTitleOrNull != null)
{
if (viewContext.isLoggingEnabled())
{
GWTUtils.displayInfo("found binding", inputDescription.getLabel() + "->"
GWTUtils.displayInfo("found binding", inputDescription.getCode() + "->"
+ boundedColumnTitleOrNull);
}
TableModelRowWithObject<ReportRowModel> selectedRow = data.get(0);
......@@ -169,7 +169,7 @@ public final class ManagedPropertyGridActionDialog extends
inputDescription.setValue(value.toString());
if (viewContext.isLoggingEnabled())
{
Info.display("bounded value", inputDescription.getLabel() + "=" + value);
Info.display("bounded value", inputDescription.getCode() + "=" + value);
}
break;
}
......
......@@ -45,13 +45,14 @@ public abstract class ManagedInputWidgetDescription implements IManagedInputWidg
return code;
}
public void setCode(String code)
public IManagedInputWidgetDescription setCode(String code)
{
if (isBlank(code))
{
throw new IllegalArgumentException("Code is null or a blank string.");
}
this.code = code.toUpperCase();
return this;
}
@Override
......
......@@ -116,16 +116,16 @@ public class ManagedPropertyField extends Field<List<Map<String, String>>>
formPanel.setLabelWidth(AbstractRegistrationForm.DEFAULT_LABEL_WIDTH - SPACING - 2);
formPanel.setFieldWidth(AbstractRegistrationForm.DEFAULT_FIELD_WIDTH);
formPanel.setHeaderVisible(false);
Map<String, TextField<?>> inputFieldsByLabel = new HashMap<String, TextField<?>>();
Map<String, TextField<?>> inputFieldsByCode = new HashMap<String, TextField<?>>();
ManagedPropertyFormHelper formHelper =
new ManagedPropertyFormHelper(viewContext, formPanel, inputFieldsByLabel);
new ManagedPropertyFormHelper(viewContext, formPanel, inputFieldsByCode);
formHelper.fillForm(widgetDescriptions);
final HorizontalPanel horizontalPanel = new HorizontalPanel();
horizontalPanel.setSpacing(SPACING);
horizontalPanel.add(formPanel);
Button removeButton = new Button("-");
removeButton.setToolTip("Delete this section.");
final Section section = new Section(inputFieldsByLabel);
final Section section = new Section(inputFieldsByCode);
removeButton.addSelectionListener(new SelectionListener<ButtonEvent>()
{
@Override
......
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