Flag (attribute of filter)

From JRapid

Jump to: navigation, search

The "auto" mode of a filter allows you to filter a listing of an entity by the value of a property.

Usage

<filter 
        display="primary | secondary" 
        flag="contains | exact" 
        label=LABEL 
        name=NAME
        property=PROPERTY
/>
  • property: the property of the entity by which the filter will filter.
  • flag can only be used with properties of type string, text or longtext.

Example

  • Adding a filter for the "name" property of a company.
    <entity label="Company" menu="Companies" name="Company">
          ...
          <property display="primary" label="Name" name="name" required="required"/>
          <filter display="primary" label="Name" name="name" property="name"/>
          ...    
    </entity>
"auto" mode filter example

In this example, if the filter definition adds flag attribute with value "contains", default behaviour is modified so the entered text tries to match any place of the existing values of the database.

    <filter display="primary" flag="contains" label="Name" name="name" property="name"/>

In this example, the result of entering "soft" in the textbox should bring 1 record with company name "Intersoft"


If the filter definition adds flag attribute with value "exact", default behaviour is modified so the entered text tries to match the whole existing values of the database.

    <filter display="primary" flag="exact" label="Name" name="name" property="name"/>

In this example, the result of entering any text would bring no results until a whole company name is entered, e.g. "Intersoft"

See also

Personal tools