Reputation: 33
I have a DWR call which returns a MAP<Employee, Double>. Employee is a class having attributes, employeeId and employeeName.
In my javascript, I m doing something like this.
for (var k in employees) {
if (employees.hasOwnProperty(k)) {
alert("EmployeeId : " + k.employeeId);
}
}
It shows me undefined
.
Upvotes: 0
Views: 109
Reputation: 119847
key? the k
is the key. maybe you meant access the value of the key:
var employee = employees[k]
if employees[k]
contains an object with the employeeId
, then:
for (var k in employees) {
if (employees.hasOwnProperty(k)) {
alert("EmployeeId : " + employees[k].employeeId);
}
}
Upvotes: 1