Skip to main content
Skip table of contents

Search Widget

Definition

The Search Widget allows to perform search on objects.

It is mandatory to configure this Widget in a feature of SEARCH Type .

Use

Description

Search form: a search form allows to customize how the user will be able to search for existing Objects.
Only searchable Attributes can be configured in this part.

Result Table: a search result table allows to customize how the values will be displayed.

Configuration

Search form

The available attributes for search are those defined in:

  • the search expression.

  • the columns (dataKey tag) and which are searchable with the drop-down list.

  • the additionalSearchAttributes tag.

Properties

Property name

Type

Mandatory

Description

Values (default value in bold)

additionalSearchAttributes

-

NO

Used to define other searchable attributes, which are not listed in the configured columns.

-

displayFrozenOperator

Boolean

NO

Allows to freeze or not operators.
This property is closely related to the <frozen> tag.

true, false

frozen

Boolean

NO

Allows to choose which parameter will be frozen.

NO, LABELS, ALL

modes

List<String>

YES

Allows to define how the user can search data.
It is mandatory to configure at least one mode.
Search modes are displayed in the order they have been configured.

-

objectReferences

-

NO

Allows to display an additional search pop-up window, using an AdvancedObjectReferenceWidget or an ObjectReferenceWidget.

-

searchExpression

-

NO

Allows to define how attributes are searchable: which attribute(s) and on which criterion(s).

Only available in a MULTICRITERIA mode.

-

additionalSearchAttributes properties

Property name

Type

Mandatory

Description

Values (default value in bold)

attribute

String

NO

Used to indicate the id of the Attribute.

-

modes properties

Property name

Type

Mandatory

Description

Values (default value in bold)

mode

String

YES

Mode configured for the search feature.

SIMPLE (in this mode, attributes must be filterable).

MULTICRITERIA (allows to combine searches involving several attributes).

FORMULA (allows to search with a pre-filled formula).

Result table

Properties

Property name

Type

Mandatory

Description

Values (default value in bold)

columns

-

YES

Allows to configure which attributes will be displayed in the columns.

-

columns properties

Property name

Type

Mandatory

Description

Values (default value in bold)

column

-

YES

Allows to define the properties of each attributes which will be displayed.

All listed attributes in the columns will be searchable in the search form.
These attributes must be searchable ("search criterion" property).

By clicking on the "Columns" button, you can display others columns (that are configured as hidden).

-

colum properties

Each column will have the following properties :

Property name

Type

Mandatory

Description

Values (default value in bold)

attribute

Boolean

NO

Used to define if the attribute is displayed or not.

true, false

dataKey

String

YES

Used to indicate the id of the Attribute.

-

dataType

String

NO

This property is only related to the display and sorting that will be performed on the dataType.

string, date, important, general, description, boolean, image, custom, data.

dateFormat

String

NO

Used to define how the date should be displayed (only if the attribute is a date or a date & time type).

HOURS_MINUTES, HOURS_MINUTES_SECONDS, DAY_MONTH_YEAR_SHORT, DAY_MONTH_YEAR_LONG, DAY_MONTH_YEAR_HOURS_MINUTES_LONG, DAY_MONTH_YEAR_HOURS_MINUTES_FULL

ellipsis

Boolean

NO

If true and if the value to be displayed is too large versus the column then “...” are displayed. The entire value will be visible when the mouse passes over it.

true, false

hidden

Boolean

NO

Used to define if the attribute is directly displayed or not in the result table.

Even if the attribute is hidden, it will be possible to display it by selecting it, i.e. by clicking on the "Columns" drop-down list

true, false

sortAs

String

NO

Allows to choose whether sorting takes priority over letters or numbers.

NUMERIC, ALPHA

sortDirection

String

NO

Allows to select whether the sorting is ascending or descending.

ASC, DESC

sortable

Boolean

NO

Allows to sort or not the values.

This property must be set to false if the attribute is not searchable.

true, false

sorted

Boolean

NO

Allows to automatically activate sorting.

Only one attribute can have its sorted value set to true.
This will be the default sort for the result table.

true, false

type

String

NO

Used to define how to display values.

string, date, important, general, description, boolean, image, custom, data, excerpt.

"excerpt" type is used to display values ​​checked as excerpt (in object type) in result columns.

Other properties

Property name

Type

Mandatory

Description

Values (default value in bold)

actions

List<Actions>

NO

Allows to configure one or several actions (like Button Widget or Groovy action rule for example).

-

allowExport

Boolean

NO

Used to define if the export of the results data is allowed or not.

true, false

rowClickActions

List<RowClickAction>

NO

Used if several actions (buttons) are displayed on the result list.
This allows to define the default action that will be launched when a result line is clicked.
This action can depend on the Object Type (so different actions can be configured for each object type).
When no RowClickActions are configured, the first listed action is executed when a result line is clicked.

rowClickActions properties

Property name

Type

Mandatory

Description

Values (default value in bold)

rowClickAction

String

NO

One rowClickAction configuration.

-

rowClickAction properties

Each rowClickAction will have the following properties :

Property name

Type

Mandatory

Description

Values (default value in bold)

actionId

String

NO

Used to define the id of the feature.

-

objectType

String

NO

Used to define the object type that is impacted for display.

-

displayFrozenOperator & frozen possible combinations

DisplayFrozenOperators

Frozen

Results

Display

true

ALL

Operators are frozen but displayed. Labels are also frozen in this case. Unable to choose any other. The values chosen for the search expression are kept.

true

LABELS

Display of defined operators but it is possible to edit them.

true

NO

Possible to select operators and labels.

false

ALL

Operators are invisible. The values chosen for the search expression are kept.

false

LABELS

Display of defined operators but it is possible to edit them.

false

NO

Possible to edit operators and labels.

Example

Search Widget Configuration Example
XML
<widget id="search-widget" xsi:type="ctdbum:SearchWidgetType">
    <hidden>false</hidden>
    <config>
      <actions>
          <action id="user-hub" xsi:type="ctdbum:ButtonWidgetType">
            <hidden>false</hidden>
            <config>
                <align>LEFT</align>
                <authenticationLevelSufficient>false</authenticationLevelSufficient>
                <borderless>true</borderless>
                <circle>true</circle>
                <color>blue-ebonyclay</color>
                <icon>fa fa-user-circle-o</icon>
                <label>true</label>
                <link>feature://user-hub/{dataKey.id}</link>
                <linkTarget>SELF</linkTarget>
                <outline>false</outline>
                <size>XS</size>
            </config>
          </action>
          <action id="user-card-update" xsi:type="ctdbum:ButtonWidgetType">
            <hidden>false</hidden>
            <config>
                <align>LEFT</align>
                <authenticationLevelSufficient>false</authenticationLevelSufficient>
                <borderless>false</borderless>
                <circle>true</circle>
                <color>blue-dark</color>
                <icon>fa fa-user-circle-o</icon>
                <label>true</label>
                <target xsi:type="ctdbum:LinkTargetType">
                   <link>feature://user-card-update/{dataKey.id}</link>
                   <target>SELF</target>
                </target>
                <outline>false</outline>
                <size>XS</size>
            </config>
          </action>
      </actions>
      <allowExport>true</allowExport>
      <columns>
          <column>
            <attribute>true</attribute>
            <dataKey>photo</dataKey>
            <dataType>string</dataType>
            <dateFormat>DAY_MONTH_YEAR_LONG</dateFormat>
            <ellipsis>false</ellipsis>
            <hidden>true</hidden>
            <sortAs>ALPHA</sortAs>
            <sortDirection>DESC</sortDirection>
            <sortable>false</sortable>
            <sorted>false</sorted>
            <type>image</type>
          </column>
          <column>
            <attribute>true</attribute>
            <dataKey>id</dataKey>
            <dataType>string</dataType>
            <dateFormat>DAY_MONTH_YEAR_LONG</dateFormat>
            <ellipsis>true</ellipsis>
            <hidden>false</hidden>
            <sortAs>ALPHA</sortAs>
            <sortDirection>ASC</sortDirection>
            <sortable>true</sortable>
            <sorted>true</sorted>
            <type>general</type>
          </column>
          <column>
            <attribute>true</attribute>
            <dataKey>firstName</dataKey>
            <dataType>string</dataType>
            <dateFormat>DAY_MONTH_YEAR_LONG</dateFormat>
            <ellipsis>false</ellipsis>
            <hidden>false</hidden>
            <sortAs>ALPHA</sortAs>
            <sortDirection>ASC</sortDirection>
            <sortable>true</sortable>
            <sorted>false</sorted>
            <type>general</type>
          </column>
          <column>
            <attribute>true</attribute>
            <dataKey>lastName</dataKey>
            <dataType>string</dataType>
            <dateFormat>DAY_MONTH_YEAR_LONG</dateFormat>
            <ellipsis>false</ellipsis>
            <hidden>false</hidden>
            <sortAs>ALPHA</sortAs>
            <sortDirection>ASC</sortDirection>
            <sortable>true</sortable>
            <sorted>false</sorted>
            <type>general</type>
          </column>
          <column>
            <attribute>true</attribute>
            <dataKey>status</dataKey>
            <dataType>string</dataType>
            <dateFormat>DAY_MONTH_YEAR_LONG</dateFormat>
            <ellipsis>false</ellipsis>
            <hidden>false</hidden>
            <sortAs>ALPHA</sortAs>
            <sortDirection>ASC</sortDirection>
            <sortable>true</sortable>
            <sorted>false</sorted>
            <type>general</type>
          </column>
          <column>
            <attribute>true</attribute>
            <dataKey>enabled</dataKey>
            <dataType>string</dataType>
            <dateFormat>DAY_MONTH_YEAR_LONG</dateFormat>
            <ellipsis>false</ellipsis>
            <hidden>false</hidden>
            <sortAs>ALPHA</sortAs>
            <sortDirection>ASC</sortDirection>
            <sortable>true</sortable>
            <sorted>false</sorted>
            <type>general</type>
          </column>
          <column>
            <attribute>true</attribute>
            <dataKey>birthDate</dataKey>
            <dataType>string</dataType>
            <dateFormat>DAY_MONTH_YEAR_SHORT</dateFormat>
            <ellipsis>false</ellipsis>
            <hidden>true</hidden>
            <sortAs>ALPHA</sortAs>
            <sortDirection>ASC</sortDirection>
            <sortable>true</sortable>
            <sorted>false</sorted>
            <type>general</type>
          </column>
          <column>
            <attribute>true</attribute>
            <dataKey>email</dataKey>
            <dataType>string</dataType>
            <dateFormat>DAY_MONTH_YEAR_LONG</dateFormat>
            <ellipsis>false</ellipsis>
            <hidden>true</hidden>
            <sortAs>ALPHA</sortAs>
            <sortDirection>ASC</sortDirection>
            <sortable>true</sortable>
            <sorted>false</sorted>
            <type>general</type>
          </column>
          <column>
            <attribute>true</attribute>
            <dataKey>Responsible_ID</dataKey>
            <dataType>string</dataType>
            <dateFormat>DAY_MONTH_YEAR_LONG</dateFormat>
            <ellipsis>true</ellipsis>
            <hidden>true</hidden>
            <sortAs>ALPHA</sortAs>
            <sortDirection>ASC</sortDirection>
            <sortable>true</sortable>
            <sorted>false</sorted>
            <type>excerpt</type>
          </column>
      </columns>
      <rowClickActions>
          <rowClickAction>
            <actionId>user-card-update</actionId>
            <objectType>Employee</objectType>
          </rowClickAction>
      </rowClickActions>
      <additionalSearchAttributes/>
      <displayFrozenOperators>true</displayFrozenOperators>
      <frozen>NO</frozen>
      <modes>
          <mode>MULTICRITERIA</mode>
          <mode>SIMPLE</mode>
          <mode>FORMULA</mode>
      </modes>
      <objectReferences>
          <objectReference>
            <attribute>Responsible_ID</attribute>
            <editWidget xsi:type="ctdbum:ObjectReferenceEditWidgetType">
                <hidden>false</hidden>
                <config>
                  <required>false</required>
                  <resultAttributes>
                      <attribute>id</attribute>
                      <attribute>lastName</attribute>
                  </resultAttributes>
                  <popupAttributes>
                      <attribute>id</attribute>
                      <attribute>status</attribute>
                  </popupAttributes>
                  <displayPopup>true</displayPopup>
                  <limit>1</limit>
                  <scope type="EXPRESSION" objectKind="IDENTITY" xsi:type="ctd:DynamicObjectScopeType">
                      <searchExpression>
                        <search:And>
                            <search:Prop op="EQUALS" name="enabled">
                              <value script="false">true</value>
                            </search:Prop>
                            <search:Prop op="EQUALS" name="status">
                              <value script="false">ACTIVE</value>
                            </search:Prop>
                        </search:And>
                      </searchExpression>
                      <objectTypes>
                        <objectType>Employee</objectType>
                      </objectTypes>
                  </scope>
                </config>
            </editWidget>
          </objectReference>
      </objectReferences>
      <searchExpression>
          <search:And>
            <search:Prop op="IS_NOT_NULL" name="id"/>
            <search:Prop op="EQUALS" name="lastName"/>
            <search:Prop op="EQUALS_LIKE" name="firstName"/>
            <search:Prop op="EQUALS" name="Responsible_ID"/>
          </search:And>
      </searchExpression>
    </config>
</widget>

Read Next

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.