B4J Question [ABMaterial] When is it absolutely necessary to call .Refresh of a component?

Mashiane

Expert
Licensed User
Longtime User
Hi there

For those components that have a .Refresh method. When is this method call absolutely necessary?

As an example, I have controls in a modal sheet / container that change and the contents are updated during Read from a database and then displayed. Is it compulsory for each of the components inside the Modal / Container to have their .Refresh methods called, e.g. after updating .Visibility and or .Text or .State properties during run time?

Does the .ShowModal method also refresh the components / one should call .Refresh method on all the components when some of the properties are changed?

Thanks?
 

alwaysbusy

Expert
Licensed User
Longtime User
That is where you as a programmer come in. You can be lazy and e.g. do a container.refresh which will refresh everything within the container. However, your app will be a lot faster if e.g. in your container, you only changed a labels text and in so only do a label.refresh. If everything was changed in the container, then doing a container.refresh does make sense. Updating .text and .visibility do need a refresh (although 4.32 has a .SetVisibilityFlush() method). Really depends on how your app is constructed.

As for a showmodal, this does indeed a full refresh of everything in it (because in some cases it needs to run internal Javascript which was did not run when it was created).
 
Upvote 0
Top