Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-9251

Add support for 'set-if-null' and 'set-if-empty' attributes on screens for set element.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Implemented
    • Affects Version/s: None
    • Fix Version/s: Upcoming Release
    • Component/s: None
    • Labels:
      None

      Description

      "set-if-null" controls if field can be set to null and "set-if-empty" controls if field can be set to an empty value. Both these attributes are supported by "set" element of simple-method and similar support should be there on the screen.

      As stated in the discussion:
      http://ofbiz.markmail.org/thread/hembr4hiabgwr7cs

      1. OFBIZ-9251.patch
        4 kB
        Aditya Sharma
      2. OFBIZ-9251-updated.patch
        4 kB
        Aditya Sharma

        Activity

        Hide
        aditya.sharma Aditya Sharma added a comment -

        1. Updated widget-common.xsd with the new attributes.
        2. <set> is implemented with SetField inner class of AbstractModelAction.
        3. Added new fields setIdEmpty and setIfNull & added checks for the same.

        Show
        aditya.sharma Aditya Sharma added a comment - 1. Updated widget-common.xsd with the new attributes. 2. <set> is implemented with SetField inner class of AbstractModelAction. 3. Added new fields setIdEmpty and setIfNull & added checks for the same.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Hi Aditya,

        It's OK with me, but should we not rather log as warnings rather than verbose? Actually why did you pick verbose?

        Show
        jacques.le.roux Jacques Le Roux added a comment - Hi Aditya, It's OK with me, but should we not rather log as warnings rather than verbose? Actually why did you pick verbose?
        Hide
        aditya.sharma Aditya Sharma added a comment -

        Hi Jacques,
        I just took its reference from the mini lang implementation in SetOperation.exec().
        Indeed, warning will be more apt as it might be quite helpful tracing that out.

        Show
        aditya.sharma Aditya Sharma added a comment - Hi Jacques, I just took its reference from the mini lang implementation in SetOperation.exec(). Indeed, warning will be more apt as it might be quite helpful tracing that out.
        Hide
        aditya.sharma Aditya Sharma added a comment -

        Updated logging level from verbose to warning.

        Show
        aditya.sharma Aditya Sharma added a comment - Updated logging level from verbose to warning.
        Hide
        jacques.le.roux Jacques Le Roux added a comment - - edited

        Thanks Aditya,

        Your slightly modified patch is in at r1794513

        I fixed "if" formatting (missing space before parenthesis) and added default="true" in widget-common.xsd

        When you create a new patch, no need to rename it. Jira will take care of graying the old ones, we recommend this way.

        Good catch BTW

        Show
        jacques.le.roux Jacques Le Roux added a comment - - edited Thanks Aditya, Your slightly modified patch is in at r1794513 I fixed "if" formatting (missing space before parenthesis) and added default="true" in widget-common.xsd When you create a new patch, no need to rename it. Jira will take care of graying the old ones, we recommend this way. Good catch BTW
        Hide
        aditya.sharma Aditya Sharma added a comment -

        Thanks Jacques
        Sure, I will do remember that.

        Show
        aditya.sharma Aditya Sharma added a comment - Thanks Jacques Sure, I will do remember that.

          People

          • Assignee:
            jacques.le.roux Jacques Le Roux
            Reporter:
            aditya.sharma Aditya Sharma
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development