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

Support for closure, if and loop for inline groovy script in set filed of action tag.

    Details

    • Type: Improvement
    • Status: Patch Available
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Trunk
    • Fix Version/s: None
    • Component/s: framework
    • Sprint:
      Bug Crush Event - 21/2/2015

      Description

      Currently, we can use inline groovy script in set field tag of action tag in screens and forms. like
      <form>
      <action>
      <set field="tempVar" value="${groovy: someList?someList.size():0;}"/>
      </action>
      </form>
      But, we can not use closure, if or loop in this kind of inline groovy. like
      <form>
      <action>
      <set field="tempVar" value="${groovy: str=''; someList.each{str=str+it}}"/>
      </action>
      </form>

      The reason is that matching closing } braces for any opening { braces in the script are ignored and script does not get compiled if it contains any set of

      { and }.


      So, I have added a patch which makes it possible to use closure, if and loop by handling { and }

      braces occurs with in the script.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              amkumar534 Amit Kumar
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: