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

Adding a new attribute ignore-when (verry similar to use-when) that enable rendering or not a field in list or multi form.

    Details

    • Sprint:
      Bug Crush Event - 21/2/2015

      Description

      I need to define some parameters (using portlet attributes) that enable showing or not some field in my portlet taht contains a form of type "list".

      Or on a form of type list or multi, it is not possible to completely ignore a field via use-when attribute. Instead it hides the title and the column header became shifted from the table content.
      For example I want to hide the description column from my form when exampleName is choosen as sort-field.

      1. ignoreField.patch
        12 kB
        youssef khaye
      2. ignoreFiled based on trunk r1680459.zip
        3 kB
        Wei Zhang

        Activity

        Hide
        lyoussef youssef khaye added a comment -

        this will also modify :
        example/widget/example/ExampleForms.xml#ListExamples
        to illustarte this functionality

        Show
        lyoussef youssef khaye added a comment - this will also modify : example/widget/example/ExampleForms.xml#ListExamples to illustarte this functionality
        Hide
        lyoussef youssef khaye added a comment -

        this will also modify :
        example/widget/example/ExampleForms.xml#ListExamples
        to illustrate this functionality

        Show
        lyoussef youssef khaye added a comment - this will also modify : example/widget/example/ExampleForms.xml#ListExamples to illustrate this functionality
        Hide
        tzngvi Wei Zhang added a comment -

        How about enhance the OOTB field <ignore/>, such as <field name="conditionalDesc"><ignore ignore-when="'Y'.equals(ignoreDescription)/></field>?

        Show
        tzngvi Wei Zhang added a comment - How about enhance the OOTB field <ignore/>, such as <field name="conditionalDesc"><ignore ignore-when="'Y'.equals(ignoreDescription)/></field>?
        Hide
        tzngvi Wei Zhang added a comment -

        Hi youssef,

        May I know if you have a patch for latest trunk? Can you please share it if possible?

        Thanks,

        Wei

        Show
        tzngvi Wei Zhang added a comment - Hi youssef, May I know if you have a patch for latest trunk? Can you please share it if possible? Thanks, Wei
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Interestin, quick non functional patch review

        1. This patch is not based on trunk, example is now in specialpurpose.
        2. Are you sure (did not try because of 1), you need to use
          &amp;&amp;
          

          in

          <set field="ignoreDescription" value="${groovy: if(sortField &amp;&amp; 'exampleName'.equals(sortField)) return 'Y' else return 'N'}"/>
          

          ?

        Show
        jacques.le.roux Jacques Le Roux added a comment - Interestin, quick non functional patch review This patch is not based on trunk, example is now in specialpurpose. Are you sure (did not try because of 1), you need to use &amp;&amp; in <set field= "ignoreDescription" value= "${groovy: if (sortField &amp;&amp; 'exampleName'.equals(sortField)) return 'Y' else return 'N'}" /> ?
        Hide
        tzngvi Wei Zhang added a comment -

        ignore filed patches based on trunk r1680459

        Show
        tzngvi Wei Zhang added a comment - ignore filed patches based on trunk r1680459
        Hide
        tzngvi Wei Zhang added a comment -

        @Jacques,

        I have worked out a new patch based on latest trunk. Can you please test it and commit it to the trunk if it is tested ok?

        Thanks,

        Wei

        Show
        tzngvi Wei Zhang added a comment - @Jacques, I have worked out a new patch based on latest trunk. Can you please test it and commit it to the trunk if it is tested ok? Thanks, Wei
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Thanks Youseef and Wei,

        Youseef your patch updated by Wei is committed in trunk at revision: 1680865

        Wei I quickly had a look at the ignored tag. I thought it was much easier to follow the use-when way and the code was ready, so here it is

        Show
        jacques.le.roux Jacques Le Roux added a comment - Thanks Youseef and Wei, Youseef your patch updated by Wei is committed in trunk at revision: 1680865 Wei I quickly had a look at the ignored tag. I thought it was much easier to follow the use-when way and the code was ready, so here it is

          People

          • Assignee:
            jacques.le.roux Jacques Le Roux
            Reporter:
            lyoussef youssef khaye
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development

                Agile