Refresh Web Component command

Official Content
This documentation is valid for:

The Web Component object Refresh command executes a Refresh of the web component itself and the web components it contains.

This causes the web component to execute the Start, Refresh and Load events.

Syntax

<web component>.Refresh

Example

It is very useful when the Web User Experience property is set to "Smooth" because it allows Refreshing only the web components needed, leaving out the others in the web page so as to avoid making a full refresh of the page.

Suppose you need to refresh a web component that is contained in the same web page and in the same level of the web component where an event is triggered.
For example, you have a web page which loads web component A and web component B. Web Component A has the following code:

Event "GetBalance"
    &UserBalance = GetUserBalance(&UserId)
    &websession.set("UserBalance",&UserBalance)
EndEvent

Web Component B uses &UserBalance to display information in the form. It won't get the information from &UserBalance unless the previous code includes an explicit refresh which causes web component B to reload.


Event "GetBalance"
    &UserBalance = GetUserBalance(&UserId)
    &websession.set("UserBalance",&UserBalance)
    WebComponentB.refresh()
EndEvent

This causes web component B to execute the Start, Refresh and Load events, so &UserBalance can be read from the web session in the Refresh event.

See Also

Event Execution Scheme
Event execution on the client side in X Evolution 3