CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Listview item's Picture not loaded correctly

General discussion

by Girish » 10 Jul 2014 12:51

Hello
I am trying to load picture from an imagelist in the istview items created runtime, however i see the picture loaded but not a correct image.
Why this is so? please find attached sample and help me to pin point the problem.
Thanks
You do not have the required permissions to view the files attached to this post.
Girish
 
Posts: 12
Joined: 09 May 2014 15:54

by Jorge Sousa » 10 Jul 2014 14:31

Hi

Before we see your demo.

all TIWCGPicture have by default UserCache=False, and this means that the image is cached by application, it's created only once.

If you need to make change the image in an ajax/async event, you need to set Picture.UserCache=True
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Jorge Sousa » 10 Jul 2014 16:22

Hi

ok, having take a look at your project, In this case, you don't need UserCache, because the images will be the same, no matter what the session is, right?

You just have to delete the project output folder wwwroot\imgcache and if the urls were already cached by the browser, you need to clear the browser cache (ctrl+F5)

If UserCache=True, a copy of the image will be created for each session to the user cache, managed by Intraweb.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Girish » 10 Jul 2014 19:27

Hello
I am loading this image depending on query results and images can be changed at any time according to results, for example , list view display the email messages and its picture representing whether email messages is been read or unread, suppose 4th item was unread(so unread image is loaded) and user read that message from another desktop application(which also change status in DB), now on IW web application if i refresh (refresh button in my app which in turn reload the list view), 4th item in list should change the image (another picture representing that message has been read)
Girish
 
Posts: 12
Joined: 09 May 2014 15:54

by Jorge Sousa » 10 Jul 2014 23:05

Hi Girish

Then, since the images are session dependEnt, then you have to set .UserCache=True, so that images can have a unique link per session.

ie, you have to do

with Items.add do
begin
{..}
Picture.UserCache=True;
end;
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Jorge Sousa » 11 Jul 2014 18:56

Hello

Also because in IW14, bmp extension is not handled as a default mime type, you must add this to ServerController unit

uses
IWInit, IWGlobal, IWMimeTypes;

procedure TIWServerController.IWServerControllerBaseCreate(Sender: TObject);
begin
TIWMimeTypes.RegisterType('.bmp','image/bmp',True);
end;

Attached are the changed units
You do not have the required permissions to view the files attached to this post.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Girish » 14 Jul 2014 13:30

Hello
I am sending you again sample using the files you sent me i was even not able to see images.
you can check snapshot at http://screencast.com/t/ZUnxAClEM
You do not have the required permissions to view the files attached to this post.
Girish
 
Posts: 12
Joined: 09 May 2014 15:54

by Jorge Sousa » 14 Jul 2014 14:37

Hello

As you can see by the binary here, it works in IW14.0.32.

You've IW14.0.28, and must be the only reason. Can you easily install IW14.0.32? This new Intraweb cache method, has been giving us an headache
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Girish » 14 Jul 2014 16:50

Yes right the exe you posted works fine but I installed Intraweb 14.0.32 and compatible Cgdevtool components....still same results. :(
now what to do? do u suggest session with Teamviewe to see at my sider?
Girish
 
Posts: 12
Joined: 09 May 2014 15:54

by Jorge Sousa » 14 Jul 2014 17:25

Hello

Thats strange, ok, can you ping us on skype, id cgdevtools? t.i.a.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

Next

Return to General

Who is online

Users browsing this forum: No registered users and 4 guests

Contact Us.