Hi All,

I am using a two way pick list my requestor form in workflow. The pick
list is populated with the roles.

The pick list is populated like:

Left Side of the Pick List: Role names which can be assigned to user.
Right side of the pick list: Role names which are already assigned to
user.

This picklist is populated by the following code:

populateRight();
populateLeft();

function populateLeft(){
var JobCode = form.getValues("varJobCode");
var SubDeptName = form.getValues("Department");
var DeptUnit = form.getValues("DepartmentUnit");
var Facility = form.getValues("PrimaryLocation");
var PermissiblePosition = (JobCode + "+" + SubDeptName + "+" + DeptUnit
+ "+" + Facility);
var RoleType = "Core";
var PermissibleRoles = new Array();
PermissibleRoles = IDVault.globalQuery(null,
"GetRolesCorrespondingtoPermissiblePosition",
{"PermissiblePositions":PermissiblePosition, "RoleType":RoleType})
var PermissibleRolesDN = new Array();
var PermissibleRolesString = PermissibleRoles[0].toString();
PermissibleRolesString = PermissibleRolesString +",";
PermissibleRolesDN = PermissibleRolesString.split("o=chw,");

var PermissibleRoleNames = new Array();
var k=0;
while(k<(PermissibleRolesDN.length)){
PermissibleRoleNames[k] = IDVault.get(null,
PermissibleRolesDN[k].toString()+"o=chw", 'Role', 'chwUPRoleName');
k++;
}
var i = 0;
while(i<(PermissibleRoleNames.length-1)){
form.setValues("CoreRoles",
PermissibleRoleNames[i].toString(),PermissibleRoleNames[i].toString(),true)
i++;
}
}
function populateRight(){
var v= new Array();
var recipientDN = form.getValues("recipient");
v = IDVault.get(null,recipientDN.toString(), 'user', 'nrfMemberOf');
var CurrentRolesName = new Array();
var f = 0;
while(f<v.length){
var checkRoleType = IDVault.get(null, v[f].toString(), 'Role',
'chwUPRoleType');
if(checkRoleType =="Core"){
CurrentRolesName[f] = IDVault.get(null, v[f].toString(), 'Role',
'chwUPRoleName');
}else{
CurrentRolesName[f] = "";
}
f++;
}
var j = 0;
while(j<CurrentRolesName.length){
if(CurrentRolesName[j].length!=0){
form.setValues("CoreRoles",
CurrentRolesName[j],CurrentRolesName[j],true);
}
j++;
}
field.select(CurrentRolesName);
}


Now i have to populated another picklist with some values as per the
selection done by the user in the left side of the two way picklist.

I am unable to solve this puzzle as i dnt know how to identify which
value is selected on the left side of the 2 way picklist.
I am also confused as both (left & right) have the same name of the
picklist, so how we can identify data is selected on frm which side of
the picklist.

Thanks in advance...


--
awasthpe
------------------------------------------------------------------------
awasthpe's Profile: http://forums.novell.com/member.php?userid=43420
View this thread: http://forums.novell.com/showthread.php?t=363960