Page 1 of 1

JQMListView and loading unique Pictures per Item

PostPosted: 10 Mar 2018 21:38
by kmmagic
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;

Re: JQMListView and loading unique Pictures per Item

PostPosted: 10 Mar 2018 22:30
by kmmagic
Uploaded Test project that demonstrates the issue. Also emailed.

Re: JQMListView and loading unique Pictures per Item

PostPosted: 11 Mar 2018 07:20
by kmmagic
Ohhhhh k. I come back from a dinner party and now the example I sent you works. ???

When I was trying to debug this I'm sure that I cleared my browser cache to no avail.

Have you seen this happen before where the images don't get loaded in properly and a single one repeats?

If so is there anything I can do to mitigate it?

Regards,

Kevin

Re: JQMListView and loading unique Pictures per Item

PostPosted: 12 Mar 2018 17:09
by kmmagic
Update...
So the problem seems to be most prevalent in Chrome. Mobile Site works fine in Safari, IE and Edge
Regards,

Kevin

Re: JQMListView and loading unique Pictures per Item

PostPosted: 15 Mar 2018 10:33
by Alexander Bulei
Hi kmmagic,

Please send me the same testcase but without FireDAC?

Best Regards.