ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Action Bar control
  • Overview
  • Handling an Action Bar through programming
  • Managing the views
  • Search in the Action Bar (system only)
  • WLanguage properties
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
Handling an Action Bar through programming
Overview
An Action Bar can be handled through programming. To do so, use the variable corresponding to the Action Bar in the code.
The variable of the Action Bar corresponds to the name of the Action Bar.
This help page explains how to handle an Action Bar through programming.
Handling an Action Bar through programming
AndroidiPhone/iPad

Managing the views

The "Modification of displayed view" process is used to manage the change of view.
In this case, the variable corresponding to the Action Bar corresponds to the number of the selected view. This allows you to manage the internal window associated with the view:
SWITCH ACTB_ActionBar
CASE 1
ChangeSourceWindow(ABZ_Dish, IW_ListDishes, "Starters", "")
CASE 2
ChangeSourceWindow(ABZ_Dish, IW_ListDishes, "Dishes", "")
CASE 3
ChangeSourceWindow(ABZ_Dish, IW_ListDishes, "Desserts", "")
END
AndroidiPhone/iPad

Search in the Action Bar (system only)

To allow a search in the Action Bar:
  1. Check "Allow the search in the Action Bar". A new event is automatically associated with the Action Bar control: "Validating the search". This event makes search possible.
  2. If the "With search history" option is checked, the search history will be shown to the user.
    iPhone/iPad Remark: The "With button to clear the history" option is used to automatically clear the history.
To implement the search, perform the following operations for example:
  1. Create a search button in the Action Bar (a "Magnifier" button for example).
  2. In the code of this option, use ActionBarSearchVisible to display the search edit control. For example:
    ActionBarSearchVisible(True, "Customer to find")
  3. Open the WLanguage events associated with the Action Bar control. In the "Validating the search" event, enter the code used to perform the search and display the result. In this code, you have the ability to find out the value entered by the user via SearchValue.
    For example:
    // Find a product.
    // The result is displayed in a Looper control.
    // The searched value corresponds to a parameter of the base query of the Looper control.
    QRY_Products.ParamName = ACTB_ActionBar.SearchValue
    LooperDisplay(LOOP_QRY_Products, taReExecuteQuery)
Remarks:
  • If the history of searches is enabled:
    • when the edit control is empty, the 10 last searches are proposed.
    • when the edit is started, 10 suggestions are displayed according to what was already typed.
  • You have the ability to clear the history with ActionBarDeleteSearchHistory.
  • iPhone/iPad If the "With button to clear the history" option is selected, an option to clear the history will appear at the end of the search results.
  • Two WLanguage events are automatically added when search is enabled in the Action Bar:
    • Validating the search.
    • Modifying the search.
  • Canceling the search: To find out whether the search was canceled by the user, check the value of SearchValue in the "Validating the search" event. This value is set to "" (empty string) in case of cancellation.
Related Examples:
WM Managing Contacts Cross-platform examples (WINDEV Mobile): WM Managing Contacts
[ + ] This example presents the management of contacts for Android et iOS.
It is used o:
- list the contacts found on the phone
- call the contacts
- send SMSs to the contacts
- ...
WM Shopping Cross-platform examples (WINDEV Mobile): WM Shopping
[ + ] WM Shopping allows you to manage several purchase lists.
To add a product:
- Scan the bar code to add it directly
- or find a product that was added beforehand and add it!
- or add a product from your purchase history!
Then, you will have the ability to edit the quantity, the image... and to add notes as reminders!

WLanguage properties

For a complete list of WLanguage properties that can be used with an Action Bar, see Properties associated with the Action Bars.
iPhone/iPad The properties of an Action Bar control cannot be modified through programming.
Minimum version required
  • Version 17
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/12/2023

Send a report | Local help