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

Discussion in 'B4J Questions' started by Mashiane, Jul 10, 2018.

  1. Mashiane

    Mashiane Expert Licensed 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?
     
    joulongleu likes this.
  2. alwaysbusy

    alwaysbusy Expert Licensed 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).
     
    Harris, mindful, Erel and 4 others like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice