Trace:
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
jvx:client:model:data:filter [2018/02/01 08:02] admin created |
jvx:client:model:data:filter [2022/01/07 11:45] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
~~Title: Data Filtering~~ | ~~Title: Data Filtering~~ | ||
- | [[jvx:client:model:data:database|Displaying Data from a Database Table]] is a basic requirement for database applications. Restricting the data volume is another requirement. This can be done on the client side as well as at the database. | + | [[jvx:client:model:data:database|Displaying data from a database table]] is a basic requirement for database applications. Restricting the data volume is another requirement. This can be done on the client side as well as at the database. |
- | At the client, data is filtered in the main memory, which, however, requires that all data is transferred from the server/database to the client. This limits communication and should not be an issue for small data volume. However, it should be noted that data has to be updated manually! | + | At the client, data is filtered in the main memory.However, this requires that all data is transferred from the server/database to the client. This limits communication and should not be an issue for small data volume, but it should be noted that data has to be updated manually! |
- | Filtering at the database is the default setting and is usually the better choice. Here, the sorting conditions are included in the SQL command and the data volume is therefore limited by the database. Only the limited data is provided to the client and due to load-on-demand only the required amount is transferred. In addition, the transferred data is always current. | + | Filtering at the database is the default setting and is usually the better choice. Here, the sorting conditions are included in the SQL command and the data volume is therefore limited by the database. Only the limited data is provided to the client and, due to load-on-demand, only the required amount is transferred. In addition, the transferred data is always current. |
==Example== | ==Example== | ||
Line 40: | Line 40: | ||
</file> | </file> | ||
- | The filter or condition is applied to a RemoteDataBook and is constructed just as it would in SQL. The search is based on our condition for the appearance of the entered text, either first name, last name, the street or the city. | + | The filter or condition is applied to a RemoteDataBook and is constructed just as it would in SQL. The search is based on our condition for the appearance of the entered text, either first name, last name, the street, or the city. |
For sorting at the client, the RemoteDataBook would have to be configured as follows: | For sorting at the client, the RemoteDataBook would have to be configured as follows: | ||
Line 47: | Line 47: | ||
rdbContacts.setMemFilter(true); | rdbContacts.setMemFilter(true); | ||
</file> | </file> | ||
+ | |||
+ | The following filter classes are available: | ||
+ | |||
+ | * ContainsIgnoreCase | ||
+ | * EndsWithIgnoreCase | ||
+ | * Equals | ||
+ | * Greater | ||
+ | * GreaterEquals | ||
+ | * Less | ||
+ | * LessEquals | ||
+ | * Like | ||
+ | * LikeIgnoreCase | ||
+ | * LikeReverse | ||
+ | * LikeReverseIgnoreCase | ||
+ | * StartsWithIgnoreCase | ||
+ | * Not | ||
+ | * Or | ||
+ | * And | ||
+ | |||
+ | Please note that a filter must always be reassigned after changing it, e.g.: | ||
+ | |||
+ | <file java> | ||
+ | filter = filter.and (new Equals ("CODE", "A-123"). and (new Equals ("REF", "re133"))); | ||
+ | </file> | ||
+ | |||
+ | Without the assignment of '' filter = filter ... '' the filter is not changed. | ||
+ | |||
+ | For further details, see [[https://www.sibvisions.com/files/jvx/current/api/javax/rad/model/condition/package-summary.html|javadoc]]. |