Changes I make to my VLF-ONE screen content do not appear, or appear later than I expected them to?

VLF-ONE filter or command handler is made of normal Visual LANSA Web code.

Visual LANSA Web screens do not change their visible content until your RDMLX code 'yields' control.

Yielding allows the Visual LANSA Web engine to (re)paint any changes onto the screen.

This means you cannot make a screen change to have a 'now busy' message and then run code for 20 seconds because the Visual LANSA Web engine will never get a chance to paint the screen change. The 'now busy' message will not appear until your code completes execution 20 seconds later. If your code also cleared the message at the end of executing, the nett visible effect to the user would be for them to see nothing. Similarly, updating a visible counter on screen will not change its visualization until your code yields control.   

If you make screen change and you want it to become visible immediately, you need to yield control back to the Visual LANSA Web engine so it can change the screen.

The two most common ways to yield so that screen changes can get painted are:

1 - Execute a server module asynchronously

Typically you see this happening in VLF-ONE code where a save method (say) starts by:

    #COM_OWNER.avGotoBusyState Showbusytext(“Saving You Changes”) Animated(False)

 

And then it asynchronously executes a server module to save some data. When that completes the routine typically then says:

     #com_Owner.avGotoFreeState

 

The reason that the “Saving Your Changes” busy state appears is because the asynchronous execution of the service module yields control.

The reason that it disappears again is because the save code typically ends execution after the GotoFreeState operation, thus yielding control. 

 

2 - Use a timer

Your code yields control until the timer ticks and can then start (or resume) what it really wants to do. For example, if you wanted a 'visual progress indicator' to update, you might fire a timer to start things rolling, do 100 things, fire the timer again and stop, do 100 more, fire the timer again and stop, etc. until you are 100% complete.  Every time you fire the timer and stop your code you allow the Visual LANSA Web engine to change how the progress indicator looks.  

Also see:

Synchronous Processing

Asynchronous Processing