CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Problem on showing image in panel list item

by Davide » 24 Jun 2017 12:03

Hello,

I'm trying to implement an imagelist so every time a user upload an image I update the image list.
After the image is uploaded the following code runs but the shown image is always the first I uploaded even though the "FileName" is different:

ImagesPanelList.Items.BeginUpdate;
try
with ImagesPanelList.Items.Add do
begin
PictureOptions.Picture.Url := FileName;
Caption := FileName;
end;
finally
ImagesPanelList.Items.EndUpdate;
end;
ImagesPanelList.AjaxReRender();

What I'm doing wrong?
Is the use of PanelList the best way to implement an image list?

Thank you,
Davide
Davide
 
Posts: 150
Joined: 14 Oct 2013 11:33

by Alexander Bulei » 26 Jun 2017 09:30

Hi Davide,

Better, you send us the simple demo.. for the faster help :)

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

by Davide » 26 Jun 2017 14:37

Hi Alexander,

attached you can find a sample as requested.

Thank you,
Davide
You do not have the required permissions to view the files attached to this post.
Davide
 
Posts: 150
Joined: 14 Oct 2013 11:33

by Alexander Bulei » 27 Jun 2017 10:04

Hi Davide,

After the checking your demo, you need change/add the follow code:

delphi code
procedure TPropertyFrame.AddPhotoButtonJQButtonOptionsClick(Sender: TObject; AParams: TStringList);
begin
FUploadedFileName := ''; // CGDEVTOOLS: from - PhotoDialogExCancelClick
PhotoFileUpload.FileNames.Clear; // CGDEVTOOLS: from - PhotoDialogExCancelClick
PhotoFileUpload.JQFileUploadOptions.ClearStoredFiles;
PhotoDialogEx.Visible := True;
end;

procedure TPropertyFrame.PhotoDialogExCancelClick(Sender: TObject; AParams: TStringList);
begin
PhotoDialogEx.Visible := False;
end;


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

by Davide » 27 Jun 2017 16:12

Hello Alexander,

I understood my mistake...

Thank you,
Davide
Davide
 
Posts: 150
Joined: 14 Oct 2013 11:33


Return to CGPanelList

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.