Eli Mesika has submitted this change and it was merged.
Change subject: webadmin,userportal: Use "[N/A]" for empty values in forms
......................................................................
webadmin,userportal: Use "[N/A]" for empty values in forms
In all forms based on FormBuilder / FormItem API (including
all "General" sub-tabs), the value "[N/A]" is used when the
resolved (actual or default) text is either null or empty.
Consider following example:
// Value widgets bound to corresponding model,
// typically managed via GWT Editor framework
TextBoxLabel fooValueWidget = new TextBoxLabel();
TextBoxLabel barValueWidget = new TextBoxLabel();
// Form item "Foo"
formBuilder.addFormItem(
new FormItem("Foo Label", fooValueWidget, 0, 0)
.withEmptyValue("[Empty]") // overrides "[N/A]"
);
// Form item "Bar"
formBuilder.addFormItem(
new FormItem("Bar Label", barValueWidget, 0, 1)
.withDefaultValue("Qux", defaultValueCondition)
);
When rendering "Foo" item:
* if fooValueWidget's text is null or empty,
the value will be rendered as "[Empty]"
When rendering "Bar" item:
* if barValueWidget's text is null or empty
and defaultValueCondition doesn't hold true,
the value will be rendered as "[N/A]"
* if barValueWidget's text is null or empty
and defaultValueCondition does hold true,
the value will be rendered as "Qux"
Change-Id: Ifde07366b36aca6adeeb880539c0aa6fc92d119c
Bug-Url:
https://bugzilla.redhat.com/1191484
Signed-off-by: emesika <emesika(a)redhat.com>
Signed-off-by: Vojtech Szocs <vszocs(a)redhat.com>
---
M
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/form/FormItem.java
1 file changed, 28 insertions(+), 1 deletion(-)
Approvals:
Eli Mesika: Verified; Looks good to me, approved; Passed CI tests
--
To view, visit
https://gerrit.ovirt.org/44002
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifde07366b36aca6adeeb880539c0aa6fc92d119c
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <emesika(a)redhat.com>
Gerrit-Reviewer: Alexander Wels <awels(a)redhat.com>
Gerrit-Reviewer: Einav Cohen <ecohen(a)redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Oved Ourfali <oourfali(a)redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vszocs(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org