CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

JQMListView and loading unique Pictures per Item

by kmmagic » 10 Mar 2018 21:38

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;
kmmagic
 
Posts: 43
Joined: 28 Dec 2016 11:54

by kmmagic » 10 Mar 2018 22:30

Uploaded Test project that demonstrates the issue. Also emailed.
kmmagic
 
Posts: 43
Joined: 28 Dec 2016 11:54

by kmmagic » 11 Mar 2018 07:20

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
kmmagic
 
Posts: 43
Joined: 28 Dec 2016 11:54

by kmmagic » 12 Mar 2018 17:09

Update...
So the problem seems to be most prevalent in Chrome. Mobile Site works fine in Safari, IE and Edge
Regards,

Kevin
kmmagic
 
Posts: 43
Joined: 28 Dec 2016 11:54

by Alexander Bulei » 15 Mar 2018 10:33

Hi kmmagic,

Please send me the same testcase but without FireDAC?

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQMListView

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.