Page 1 of 1

Problem on showing image in panel list item

PostPosted: 24 Jun 2017 12:03
by Davide
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

Re: Problem on showing image in panel list item

PostPosted: 26 Jun 2017 09:30
by Alexander Bulei
Hi Davide,

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

Best Regards.

Re: Problem on showing image in panel list item

PostPosted: 26 Jun 2017 14:37
by Davide
Hi Alexander,

attached you can find a sample as requested.

Thank you,
Davide

Re: Problem on showing image in panel list item

PostPosted: 27 Jun 2017 10:04
by Alexander Bulei
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.

Re: Problem on showing image in panel list item

PostPosted: 27 Jun 2017 16:12
by Davide
Hello Alexander,

I understood my mistake...

Thank you,
Davide