Hi
I'm looking how to do the server side validations like to retrieve the List of Sorted ones, If the user selects first department as ist position in Asc and then salary 2nd postion Desc and then Age as the 3rd as Asc.
The drop dwon and the Asc/Desc Radio buttons should be Dynamic.
Please could you help me with the code at the .
I have a two classe one with SortManage and other one SortBy
public class SortManager {
List sortbyList = null;
/**
* @param sortBy
*/
public void addSortBy(SortBy sortBy) {
if ( sortbyList == null ){
sortbyList = new ArrayList();
}
sortbyList.add(sortBy);
}
public List getSortConfig() {
return this.sortbyList;
}
public String toString() {
for ( Iterator f = sortbyList.iterator(); f.hasNext()

{
SortBy sortBy = (SortBy) f.next();
sortBy.toString();
}
return "";
}
}
And other SOrtBY Class
public class SortBy {
private String sortColumnName;
private String sortDisplayTitle;
private int position;
private String sortOrder;
/**
* @return Returns the position.
*/
public int getPosition() {
return position;
}
/**
* @param position The position to set.
*/
public void setPosition(int position) {
this.position = position;
}
/**
* @return Returns the sortOrder.
*/
public String getSortOrder() {
return sortOrder;
}
/**
* @param sortOrder The sortOrder to set.
*/
public void setSortOrder(String sortOrder) {
this.sortOrder = sortOrder;
}
/**
* @param sortColumnName
*/
public void setColumnName(String sortColumnName) {
this.sortColumnName = sortColumnName;
}
/**
* @param sortDisplayTitle
*/
public void setDisplayTitle(String sortDisplayTitle) {
this.sortDisplayTitle = sortDisplayTitle;
}
/**
* @return Returns the sortColumnName.
*/
public String getSortColumnName() {
return sortColumnName;
}
/**
* @return Returns the sortDisplayTitle.
*/
public String getSortDisplayTitle() {
return sortDisplayTitle;
}
public String toString(){
System.out.println ("Sort Column Name -> "+ sortColumnName + " Sort Display Title "+ sortDisplayTitle );
return "";
}
}
And the XML file as
<property-group name ="ScreenDefinitions">
<property-group name="ScreenDefinition">
<property-group name="DisplayEmployees">
<property-group name="Filters">
<property name="Filter1">Department</property>
<property name="Filter2">Age</property>
</property-group>
<property-group name="FilterDependencies">
<property-group name="Age">
<property name="DependsOnFilter1">Department</property>
</property-group>
</property-group>
<property-group name="Sort">
<property-group name="Column1">
<property name="ColumnName">empName</property>
<property name="DisplayTitle">Employee Name</property>
</property-group>
<property-group name="Column2">
<property name="ColumnName">dept</property>
<property name="DisplayTitle">Department</property>
</property-group>
</property-group>
</property-group>
</property-group>
</property-group>
I have the following flows
1.User Clicks the Sort by button on the Main Screen
2.Sort by pop-up window Screen is displayed with default sort order.
3.User selects sorted selection criteria as desired as by Column name, by position and the order
4.User clicks "OK" button and the selected sort by information would be saved into memory and (i.e. the values would be retained as long as the user in the session) will go back to the main screen.
alternate flow would be
1.User clicks the Sort by button on the filter screen.
2.Sort by pop-up window screen is displayed with default sort order.
3.User specifies the order of position multiple times.
4.User clicks the Ok button.
5.Displays an error message "Ordering of position of columns have been specified multiple times" to sort.
Appreciate if you would help with the validations code.
Regards
Shyam