Basic Filter

From JRapid

Jump to: navigation, search

basic is a filter mode.


Contents

Description

The basic mode allows you to specify multiple conditions for a 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.

Use and and or to combine conditions.

Usage

<filter 
   display = "primary"
   entity = ENTITY
   type = TYPE
   label = LABEL
   name = NAME >
      <condition
         field = FIELD
         OPERATOR = VALUE 
      />
</filter>


Example

Filtering the company entity listing by the lastName of the sales representative.

    <entity label="Company" menu="Menu" name="Company">
        <property display="primary" label="Name" name="name"/>
        <property label="Address" name="address" type="text"/>
        <property label="Active" name="active" type="boolean"/>
        <property display="secondary" entity="SalesRepresentative" label="Sales Representative" name="salesRep"/>

        <filter display="primary" label="Sales Representative" name="salesRepFilter" type="string">
            <condition like="concat(salesRepFilter, '%')" field="salesRep.lastName"/>
        </filter>
    </entity>

    <entity label="Sales Representative" menu="Persons" name="SalesRepresentative">
        <property display="primary" label="First Name" name="firstName"/>
        <property display="primary" label="Last Name" name="lastName"/>
    </entity>

File:filter_basic1.jpg


Filter a company based on the number of employees. The filter uses a greater or equals operator.

    <entity label="Company" menu="Menu" name="Company">
        <property display="primary" label="Name" name="name"/>
        <property display="secondary" label="Number Of Employees" name="numberOfEmp" type="integer"/>

        <filter display="primary" label="Number Of Employees" name="numberOfEmpFilter" type="integer">
            <condition field="numberOfEmp" ge="numberOfEmpFilter"/>
        </filter>
    </entity>


File:condition1.jpg

See also

Personal tools