Page 1 of 1

JQImage how to make image dynamically visible

PostPosted: 08 Nov 2014 23:43
by JohnFSklavounos
Hi Guys,

I've been trying to make a JQImage dynamically visible with no success and could use some help. The image is in a JQRegion - the attributes are set as follows:

JQImage
Enabled := true;
LoadHidden := true;
RenderInvisibleControls := true;
StyleRenderOptions includes RenderVisibility
Visible := false;

JQRegion
Enabled := true;
LoadHidden := true;
RenderInvisibleControls := true;
StyleRenderOptions includes RenderVisibility
Visible := true;

Try #1
JQImage.Visible := true;
JQImage.AjaxReRender();

Try #2
JQImage.Visible := true;
RenderRegionAsync(JQRegion, False, True);

Try #3
JQImage.Visible := true;
JQImage.AjaxReRender();
RenderRegionAsync(JQRegion, False, True);

I've been trying several different ways but to no avail... Any ideas?

Thanks!
John

Re: JQImage how to make image dynamically visible

PostPosted: 10 Nov 2014 13:04
by Alexander Bulei
Hi JohnFSklavounos,

've been trying to make a JQImage dynamically visible


I think, you mean async...
But you dont need to use the AjaxReRender/RenderRegionAsync.

Just do this:

delphi code
JQImage.Visible := True;


I tested here with your settings and works as expected.

Best Regards.

Re: JQImage how to make image dynamically visible

PostPosted: 10 Nov 2014 17:04
by JohnFSklavounos
Wow, I see what you mean... I tried it out with code from an even in the same region and that's exaclty how it worked. I now realize that I didn't give enough information about my difficulty.

The code that determines the visibility of the JQImage runs in an async event from another region - that's why I was running the AjaxReRender for the image and RenderRegionAsync code for the region. I have several regions on this form and didn't want to have to referesh the whole thing.

Thanks! :)
John

Re: JQImage how to make image dynamically visible

PostPosted: 25 Apr 2019 15:38
by bob9999
I am having an issue getting the image to async update. I load the image on file when the form loads and then I can update the picture.url to point to a new picture. IWCGJQImage1.Picture.Url := 'image_users\' + inttostr(UserSession.iOperatorID) + '-<filename>.jpg';

The issue is that the image never updates on the scree for the user to show the change. This is the same issue I was having with IWimage component and during sales cycle with CG I was told this component has this feature but darned if I can figure out how this works.

I tried the AjaxReRender() that I use for other components but I receive an error saying that I am not allowed.

How do I get the image to update its the picture displayed to the user?

Cheers!

Re: JQImage how to make image dynamically visible

PostPosted: 14 Dec 2019 05:47
by bob9999
Just to finish this thread the only way I could get the image to refresh is to have in a region and then ajax rerender that and then the image will update. Cheers!