Basic mode

From JRapid

(Redirected from Property filter basic-mode)
Jump to: navigation, search

The "basic" mode allows you to specify multiple conditions for filtering a listing. It extends the auto mode in the sense you can navigate the properties of the properties of the entity to create a condition.

Usage:

   <filter display="primary" entity=ENTITY label=LABEL name=NAME>
            <condition field=FIELD value=VALUE/>
   </filter>
  • entity: the entity of the property by which the filter will filter, it is only required when the "field" attribute is of type entity.
  • field: the property by which the filter will filter.
  • value: a fixed value or a reference to the name of the filter which is the user input.
  • operator: a operator for filtering the results.

Example:

  • Specifying the "entity" attribute of a filter.
<entity name="company" label="Company">
   <property entity="Seller" label="Responsable" name="responsable" />
   <filter display="primary" entity="Seller" label="Responsable" name="responsableFilter">
            <condition field="responsable" value="responsableFilter"/>
   </filter>
</entity>
"entity" attribute example
  • Filtering by the "surname" of the responsable of a company.
<entity name="company" label="Company">
   <property entity="Seller" label="Responsable" name="responsable" />
   <filter display="primary" label="Responsable" name="responsableFilter">
            <condition field="responsable.surname" value="responsableFilter"/>
   </filter>
</entity>
"basic mode" example
  • Filtering by max weight using the "lt" (less than) operator:
<entity name="seller" label="Seller">
    ...
    <property name="weight" label="Weight" type="integer"/>
    <filter display="primary" label="Weight (max)" name="filterByMaxWeight" type="integer">
         <condition field="weight" lt="filterByMaxWeight"/>
    </filter>
    ...
</entity>
"basic mode" example