Page 1 of 1

Best way to show/animate loading on VL-WEB

Posted: Thu Apr 12, 2018 1:43 am
by atostaine
I am loading many images into a viewer, similar to the image carousel from the samples. I'd like to show a loading animation. I can't find any examples of that. I thought I saw that somewhere.

The image that shows while first opening a web page would be fine.

Re: Best way to show/animate loading on VL-WEB

Posted: Thu Apr 12, 2018 2:41 am
by jyoung
Drop an image on you page and then use

Code: Select all

evtroutine handling(#COM_OWNER.CreateInstance)
#LoadingImage.Image <= #SYS_WEB.LoadingImage
endroutine
Then you can show/hide your image as needed.

https://docs.lansa.com/14/en/lansa016/p ... gimage.htm

Re: Best way to show/animate loading on VL-WEB

Posted: Thu Apr 12, 2018 2:45 am
by atostaine
Thanks Joe. I did see how to define the image, how do you show it? I'm waiting for the easy answer I should have known.

art

Re: Best way to show/animate loading on VL-WEB

Posted: Thu Apr 12, 2018 3:01 am
by jyoung
Set the visibility of your loading image.

Code: Select all

evtroutine handling(#PTORequestDetailPanel.Loading)
#LoadingImage.Visible := True
#PTORequestDetailPanel.Visible := False
#ButtonPanel.Visible := False
endroutine

evtroutine handling(#PTORequestDetailPanel.Loaded)
#LoadingImage.Visible := False
#PTORequestDetailPanel.Visible := True
#ButtonPanel.Visible := True
endroutine
Sometimes if your loading is really fast you may not see the image.

Re: Best way to show/animate loading on VL-WEB

Posted: Thu Apr 12, 2018 3:04 am
by atostaine
Oh I see. You actually have an image control, I thought I had seen something in sys_web to set it to visible true.

Thanks

Re: Best way to show/animate loading on VL-WEB

Posted: Thu Apr 12, 2018 3:07 am
by jyoung
Right, you got to get an image control on the page, then set the reference to the SYS_WEB.LoadingImage to get the spinner gif. After that, then you can toggle the visibility of your loading image as required.

As far as I know, the SYS_WEB.LoadingImage is just there as a reference to get access to the gif. I think because you can't add a gif as a bitmap to the repo.

Joe

Re: Best way to show/animate loading on VL-WEB

Posted: Tue Apr 17, 2018 9:50 am
by BrendanB
If you place your gif files in webserver/Images directory then you can do:

#LoadingImage.Filename := 'http://anotherwebserver/Images/mygif.gif'

or:

#LoadingImage.Filename := '/Images/mygif.gif'


to set the image to a mygif.gif. In the first case, you can see that you could store the gif files on another webserver, but if they are on the same server you can omit the 'http://anotherwebserver' part of the filename.

yes, it doesnt use the repository, but it means you can use other gifs in your programs/rps.

Re: Best way to show/animate loading on VL-WEB

Posted: Tue Apr 17, 2018 2:16 pm
by dannyoorburg
If you do want to use the Repository, register your gif as an External Resource in the Partition VL-Web folder

The External Resource is now just another LANSA object in your App and you can even refer to it in your code.


#Image.FileName := #MyExternalResource


Danny

Re: Best way to show/animate loading on VL-WEB

Posted: Fri Mar 06, 2020 3:00 am
by Dino
Can you style this image? like adding a text under it, change the background color of the screen while it appears, etc.?