JQMListView and loading unique Pictures per Item

Hello CGDEV,
I have a mobile TimeSheet application that pulls information from our erp system as well as Active Directory. So this would be difficult to replicate with a demo. The procesdure below is called oncreate for the mlistview to dynamically create the items in the listview along with each individual's picture. The problem is that the same images appears (5) times in the Listview. This particular call to the procedure that I'm testing returns (5) Employees. The odd thing is that it's not the first image that is repeated and not the last, but the 4th image.
I've confirmed that the supporting routines are providing unique images for each call.
Is there anything I'm missing regarding loading pic's into individual items?
procedure TApproveTimeFrame.LoadApprovees;
var
aCNStr: String ;
NewItem: TIWCGJQMListItem;
begin
with usersession.FDQuery do
begin
Active := True;
first;
ApproveListView.Items.ClearAndResetID;
while not eof do
begin
usersession.ClientDataSet.Locate('EmployeeID',fieldbyname('EmployeeID').asstring,[]);
aCNStr:= usersession.ClientDataSet.FieldByName('CNString').AsString;
NewItem := ApproveListView.Items.Add;
NewItem.Header := Trim(FieldByName('firstname').asstring)+' '+Trim(FieldByName('lastname').asstring);
NewItem.Description := 'EmployeeID: '+FieldByName('EmployeeID').asstring;
NewItem.headerAside := 'Header ASide';
NewItem.Picture.Graphic := usersession.GetEmployeePic(aCNStr);
// This next line is put in here only for debugging and confirms when I view them that I am sending distinct images for each employee
NewItem.Picture.SaveImage('..\TestImages\'+FieldByName('EmployeeID').asstring+'.png');
next;
end;
end;
end;
I have a mobile TimeSheet application that pulls information from our erp system as well as Active Directory. So this would be difficult to replicate with a demo. The procesdure below is called oncreate for the mlistview to dynamically create the items in the listview along with each individual's picture. The problem is that the same images appears (5) times in the Listview. This particular call to the procedure that I'm testing returns (5) Employees. The odd thing is that it's not the first image that is repeated and not the last, but the 4th image.
I've confirmed that the supporting routines are providing unique images for each call.
Is there anything I'm missing regarding loading pic's into individual items?
procedure TApproveTimeFrame.LoadApprovees;
var
aCNStr: String ;
NewItem: TIWCGJQMListItem;
begin
with usersession.FDQuery do
begin
Active := True;
first;
ApproveListView.Items.ClearAndResetID;
while not eof do
begin
usersession.ClientDataSet.Locate('EmployeeID',fieldbyname('EmployeeID').asstring,[]);
aCNStr:= usersession.ClientDataSet.FieldByName('CNString').AsString;
NewItem := ApproveListView.Items.Add;
NewItem.Header := Trim(FieldByName('firstname').asstring)+' '+Trim(FieldByName('lastname').asstring);
NewItem.Description := 'EmployeeID: '+FieldByName('EmployeeID').asstring;
NewItem.headerAside := 'Header ASide';
NewItem.Picture.Graphic := usersession.GetEmployeePic(aCNStr);
// This next line is put in here only for debugging and confirms when I view them that I am sending distinct images for each employee
NewItem.Picture.SaveImage('..\TestImages\'+FieldByName('EmployeeID').asstring+'.png');
next;
end;
end;
end;