cancel
Showing results for 
Search instead for 
Did you mean: 

Compare two tables

Former Member
0 Kudos

Hello

the situation is as follow

I have two tables first will be a short employee list of employees that participated in a Quiz and another table that hold all emplyees list, Now I want to compare between the two and set a different color or a check box near an employee that participated in the global employee table, how would I do that , How would I compare between the two so at the global list I have the participated employees marked.

Thanks a lot for the help

Oren

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The solution to your problem can be as follows:

You must be having some attribute which uniquely determines an employee. Lets say it as employeeID. Now from the node of your quiz table you can get the employee IDs of all the employee participated in the quiz. Populate it in String array say empIdArr.

Now loop through the node<empGlobal> of your global employee list and check:

for(int i = 0;i<wdContext.nodeEmpGlobal().size();i++){

for(int j = 0;j<empIdArr.length();j++){

if(wdContext.nodeEmpGlobal().currentEmpGlobalElementAt(i).getEmployeeID().equals(empIdArr[j])){

wdContext.nodeEmpGlobal().currentEmpGlobalElementAt(i).setCheckBox(true);

break;

}

}

}

Here add an attribute called checkBox to the global employee node and map it to the column having checkboxes in the global employee table.

Hope this will solve your problem. I dont have idea about your context structure, but this solution can give you an idea.

For any further queries you can revert back.

thanks & regards,

Manoj

Former Member
0 Kudos

Thanks

It was very helpfull

Former Member
0 Kudos

Why an array and not a set with the IDs of the quiz participants?

Armin

Former Member
0 Kudos

Hi Armin,

It was just generic solution. Could you please elaborate what difference it would make using Set instead of an array.

thanks & regards,

Manoj

Answers (1)

Answers (1)

former_member182598
Active Contributor
0 Kudos

Hi Oren,

Can you please your problrm from the perspective of how the context is structured.? I mean how these tables are getting populated.?

regards

Prashant