Change in ovirt-engine[master]: webadmin, userportal: Use "[N/A]" for empty values in forms

emesika at redhat.com emesika at redhat.com
Wed Jul 29 12:40:20 UTC 2015


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 at redhat.com>
Signed-off-by: Vojtech Szocs <vszocs at 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 at redhat.com>
Gerrit-Reviewer: Alexander Wels <awels at redhat.com>
Gerrit-Reviewer: Einav Cohen <ecohen at redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Oved Ourfali <oourfali at redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vszocs at redhat.com>
Gerrit-Reviewer: automation at ovirt.org



More information about the Engine-commits mailing list