ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Window functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Modifies or returns the visibility state of the refresh bar in a window.
This function can be used when the window supports the "Pull-to-refresh" option. To enable this option in a window:
  1. Open the window description.
  2. In the "Details" tab, in the "Other parameters" area, check "Pull to refresh".
  3. Validate.
Example
// "Refresh data" event of the window
// -------------------------------------------------------------
// Check the display of selection bar because the refresh of
// window data will be performed in a secondary thread.
// Otherwise, the refresh bar would be automatically hidden at the
// end of the execution of the event.
WinRefreshVisible(WIN_Products, True)
// Refreshes the window data in a secondary thread
ThreadExecute("threadUpdWindow", threadNormal, ProcThreadUpdWin)
//----------------------------------------------------
// Procedure for updating the window data
PROCÉDURE ProcThreadUpdWin()
// Run an HTTP request
HTTPRequest(...)
// Goes back to the main thread to display the request content in the window
ExecuteMainThread(ProcUpdUI, HTTPGetResult())
END
// ---------------------------------------------------
// Procedure for refreshing the window interface
PROCÉDURE ProcUpdUI(sData is string)
// Process the data received
// ...
// The data is updated, hide the refresh bar
WinRefreshVisible(WIN_Products, False)
END
Syntax

Changing the state of the refresh bar Hide the details

WinRefreshVisible(<Window> , <Visible>)
<Window>: Window name
Name of window to use.
<Visible>: Boolean
  • True to display the refresh bar,
  • False to hide it.

Getting the state of the refresh bar Hide the details

<Result> = WinRefreshVisible(<Window>)
<Result>: Boolean
  • True if the refresh bar is displayed,
  • False if the refresh bar is hidden.
<Window>: Window name
Name of window to use.
Remarks
  • During a "Pull to refresh", the refresh bar corresponds to the area displayed at the top of window during the data refresh.
  • WinRefreshVisible is used for example to check the display of refresh bar when the data found in the window is refreshed in a secondary thread. This prevents the application from freezing (the example uses this method).
  • When the refresh bar is shown by WinRefreshVisible, the "Pull to refresh" event of the window is not executed.
    Remark: You can force the execution of this event by using ExecuteProcess with the trtPullToRefresh constant.
  • To hide the refresh bar, WinRefreshVisible(False) must be called as many times as WinRefreshVisible(True) was run.
Component: wd300android.aar
Minimum version required
  • Version 23
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help