--Standard Sorting on the Server Side
1 post
• Page 1 of 1
--Standard Sorting on the Server Side
This article is outdated - please use our new system at
https://doc.sibvisions.com
User-friendly UIs prepare and display data in clearly arranged form. This includes clear and relevant sorting of data.
There are several different ways to sort data and sorting can happen at various tiers. The client (client tier) can handle sorting, although that would mean that unwanted logic is located at the client. The database (data tier) also offers ways to sort data, for example, through the use of views. Unfortunately not all databases supporting sorting using views. That only leaves the application server and therefore the business logic (enterprise tier) for sorting.
The following instruction sorts the data. Please note that this is standard sorting. If the client requests a different sorting method, it will be preferred.
- Code: Select all
public DBStorage getUserDefaults() throws Exception
{
DBStorage userDefaults = (DBStorage)get("userDefaults");
if (userDefaults == null)
{
userDefaults = new DBStorage();
userDefaults.setDBAccess(getDBAccess());
userDefaults.setWritebackTable("USERS");
userDefaults.setDefaultSort(new SortDefinition(false, "USERNAME"));
userDefaults.open();
put("userDefaults", userDefaults);
}
return userDefaults;
}
-
Development@SIB - Posts: 325
- Joined: Mon Sep 28, 2009 1:54 pm
1 post
• Page 1 of 1