HttpSession session = request.getSession();
int individualID = ((UserObject)session.getAttribute("userobject")).getIndividualID();
// get data from database
ViewHome viewHome = (ViewHome)CVUtility.getHomeObject("com.centraview.view.ViewHome", "View");
View remote = (View)viewHome.create();
remote.setDataSource(dataSource);
String listType = (String)request.getParameter("listType");
Vector selectedColumn = new Vector();
if (this.getSelectedColumn() != null) {
String[] selectedCol = this.getSelectedColumn();
for (int i = 0; i < selectedCol.length; i++) {
DDNameValue ddSelectedCol = new DDNameValue(selectedCol[i], selectedCol[i]);
selectedColumn.add(ddSelectedCol);
}
}
this.setSelectedColumnVec(selectedColumn);
Vector vecColumn = (Vector)remote.getAllColumns(listType);
Vector sortMemberVec = new Vector(vecColumn);
this.setSortMemberVec(sortMemberVec);
int sizeOfAvailableList = vecColumn.size();
int sizeOfSelectedList = selectedColumn.size();
int i = 0;
int j = 0;
String idOfAvailableList = "";
String idOfSelectedList = "";
DDNameValue ddAvailableListInfo = null;
DDNameValue ddSelectedListInfo = null;
boolean removed = false;
while (i < sizeOfAvailableList) {
removed = false;
ddAvailableListInfo = (DDNameValue)vecColumn.get(i);
idOfAvailableList = ddAvailableListInfo.getStrid();
while (j < sizeOfSelectedList) {
ddSelectedListInfo = (DDNameValue)selectedColumn.get(j);
idOfSelectedList = ddSelectedListInfo.getStrid();
if (idOfAvailableList.equals(idOfSelectedList)) {
vecColumn.remove(i);
removed = true;
sizeOfAvailableList--;
break;
} else {
j++;
}
ddSelectedListInfo = null;
}
j = 0;
if (!removed)
i++;
ddAvailableListInfo = null;
removed = false;
}
this.setAvailableColumnVec(vecColumn);
Vector searchVector = (Vector)remote.getOwnerSearch(individualID, request.getParameter("listType").toString());
this.setSearchIdName(searchVector);
request.setAttribute("listId", request.getParameter("listId"));
request.setAttribute("viewform", this);
request.setAttribute("TYPEOFOPERATION", request.getParameter("TYPEOFOPERATION"));
request.setAttribute("primaryTableName", request.getParameter("primarytablename"));