Iterator eligibleEntityI = eligibleEntityL.iterator();
while (eligibleEntityI.hasNext()) {
GenericValue eligibleGV = (GenericValue) eligibleEntityI.next();
GenericPK eligiblePK = eligibleGV.getPrimaryKey();
Iterator eligiblePKFieldI = eligiblePK.getAllFields().entrySet()
.iterator();
// Add an option to the available select box for this entity.
// Example of value with 1 field in the key: "contactId:10341"
// Example of value with 3 fields in the key: "displayObjectId:10021,displayTypeId:22320,displayAttribId:SIZE"
displayHtml.append(" <OPTION VALUE=\"");
int fieldCount = 0;
StringBuffer keyStringBuf = new StringBuffer();
while (eligiblePKFieldI.hasNext()) {
Map.Entry eligiblePKField = (Map.Entry) eligiblePKFieldI.next();
Debug.logVerbose("[displaySelectSection] eligiblePKField: " +
eligiblePKField.toString(), module);
String eligiblePKFieldName = (String) eligiblePKField.getKey();
Debug.logVerbose("[displaySelectSection] eligiblePKFieldName: " +
eligiblePKFieldName.toString(), module);
String eligiblePKFieldValue = (String) eligiblePKField.getValue();
Debug.logVerbose("[displaySelectSection] eligiblePKFieldValue: " +
eligiblePKFieldValue.toString(), module);
if (++fieldCount > 1) {
keyStringBuf.append(",");
}
keyStringBuf.append(eligiblePKFieldName + ":" +
eligiblePKFieldValue);
}
// Append the key and the name.
Vector listedEntityVector = new Vector();
listedEntityVector.add(eligibleGV);
String eligibleItemName = UIUtility.decodeEntityDisplayDef(getSelectNameDef(),
listedEntityVector, "");
displayHtml.append(keyStringBuf.toString() + "\">" +
eligibleItemName + "\n");
}
displayHtml.append(" </SELECT>\n");
displayHtml.append(" </TD>\n");
// Display the arrow button.
displayHtml.append(" <TD ALIGN=\"center\">\n");
displayHtml.append(" <INPUT DISABLED TYPE=\"button\" NAME=\"" +
getSectionName() + "SelectButton\" value=\"---\" " +
"onClick=\"selectTransfer" + getSectionName() + "(this)\">\n");
displayHtml.append(" </TD>\n");
// Display the selected entities.
displayHtml.append(" <TD>\n");
displayHtml.append(" <SELECT STYLE=\"width: 100%\" " +
"NAME=\"" + getSectionName() + "AssignedSel\" ID=\"" +
getSectionName() +
"AssignedSel\" SIZE=\"10\" onChange=\"handleAssignedChange" +
getSectionName() + "()\">\n");
Iterator selectedEntityGVI = selectedEntityGVC.iterator();
while (selectedEntityGVI.hasNext()) {
GenericValue selectedGV = (GenericValue) selectedEntityGVI.next();
GenericPK selectedPK = (GenericPK) selectedGV.getPrimaryKey();
Iterator selectedPKFieldI = selectedPK.getAllFields().entrySet()
.iterator();
// Add an option to the available select box for this entity.
// Example of value with 1 field in the key: "contactId:10341"
// Example of value with 3 fields in the key: "displayObjectId:10021,displayTypeId:22320,displayAttribId:SIZE"