Nicolas Malin created OFBIZ-13349:
-------------------------------------

             Summary: Add condition-date on entity-condition element
                 Key: OFBIZ-13349
                 URL: https://issues.apache.org/jira/browse/OFBIZ-13349
             Project: OFBiz
          Issue Type: Improvement
            Reporter: Nicolas Malin


On screen or form actions, I propose to add a condition-date element on 
<entity-condition> to directly add historic filter.

Currently, element entity-condition can have a boolean attribute filter-by-date 
that filter your entity list with fromDate/thruDate on now date only.

If you need to navigate on history or use some other date fields, you can't use 
it and need to add a complex condition by hand

With condition-date you can select the date value to use and date fields for 
the filter.

Example :

Complex :
{code:java}
  <entity-condition entity-name="PartyContactDetailByPurpose">
      <condition-list>
          <condition-expr field-name="partyId" operator="equals" 
from-field="parameters.partyId"/>
          <condition-date from-field="order.orderDate" ignore-if-empty="true">
              <date-field field-name="fromDate">
              <date-field field-name="thruDate">
              <date-field field-name="purposeFromDate">
              <date-field field-name="purposeThruDate">
          </condition-date>
      </condition-list>
  </entity-condition>{code}

  
 Simple :
{code:java}
  <entity-condition entity-name="PartyContactDetailByPurpose">
      <condition-list>
          <condition-expr field-name="partyId" operator="equals" 
from-field="parameters.partyId"/>
          <condition-date from-field="order.orderDate"/>
      </condition-list>
  </entity-condition>{code}

 
 Default :
{code:java}

  <entity-condition entity-name="PartyContactDetailByPurpose">
      <condition-list>
          <condition-expr field-name="partyId" operator="equals" 
from-field="parameters.partyId"/>
          <condition-date/>
      </condition-list>
  </entity-condition>

    Equivalent to

  <entity-condition entity-name="PartyContactDetailByPurpose" 
filter-by-date="true">
      <condition-list>
          <condition-expr field-name="partyId" operator="equals" 
from-field="parameters.partyId"/>
      </condition-list>
  </entity-condition>{code}
I focused this functionality for widget element, entity-condition is also used 
on entity-view, so I need to improve it to support this others case



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to