Hi!
Check if URL is empty string?
Hmm.. yes, but I open a detail form and load everythin through XData, after loading I load also the picture with this code
procedure TfrmDetails.OnServerConnect(Sender: TObject);
begin
wdsPobuda.QueryString := '$filter=Id eq '''+IntToStr(Id)+'''&$expand=status';
wdsPobuda.Load;
end;
...
procedure TfrmDetails.wdsPobudaAfterOpen(DataSet: TDataSet);
begin
imgSlika.Url := connServer.URL + '/pobuda('+wdsPobuda.FieldByName('Id').AsString+')/Picture';
end;
Do I understand correct that the URL can be an invalid link and you want to detect that?
Ok, I'll go this way
imgPicture.Visible := imgPicture.Picture <> nil;
I'm trying to understand if the saved entity has a picture or not (picture is optional for the users). if there is no picture then on the page is displayed an ugly square and I want to hide it if there is no picture in the DB. I tried with
WEBLib.WebTools;
Set WebImageControl.URL := EmptyImage;
Ok, but how do I check that the WebImageControl has no picture in it? I set the URL
imgSlika.Url := connServer.URL + '/pobuda('+wdsPobuda.FieldByName('Id').AsString+')/Slika';
I understand that basically you want to check if an URL is valid?
Set the URL of the image and it will respond via the event OnValidated if the URL is valid or not.
I'll try this.
TWebURLValidator works for the task. Take the previous post as a suggestion for future updates.
There is no property in the TWebImageZoom component as the browser DOM doesn't offer this out of the box on the HTML IMG element.