- Overview
- Page editor: defining the actions associated with the menu options
- Code editor: defining the actions associated with the menu options
- Display the events associated with a menu option
- Events associated by default with menu options
- Dynamic programming of menu options
Programming a drop-down menu
Once the drop-down menu of your site is created, all you have to do is associate an action with each menu option. Programming the menu options can be done: - In the page editor, in the option description.
- In the code editor, by programming in WLanguage or in JavaScript.
Several WLanguage functions can also be used to handle the menu options dynamically, through programming. For more details, see Menu management functions. Remark: You have the ability to only program the ending options of the menu. Page editor: defining the actions associated with the menu options The action associated with the menu option is defined in the description window of the menu option. Reminder: To display the description window of a menu option: - Double-click the menu: a yellow border appears.
- Select the desired menu option.
- Display the popup menu of the option and select "Option description".
Code editor: defining the actions associated with the menu options Display the events associated with a menu option To display the events associated with a menu option: - Double-click the menu: a yellow border appears.
- Select the desired menu option.
- Display the popup menu of option and select "Code".
Two events are available: - Selecting the menu in browser code.
- Selecting the menu in server code (available for the dynamic pages only).
In these events, the WLanguage functions can be used to: Remark: These events are available: - for the ending options of the menu and sub-menus.
- for the main options of the menu (the ones that expand the sub-menus).
Events associated by default with menu options WEBDEV manages the following events by default (order of appearance in the code editor): | | Event | Runtime condition |
---|
Selection of option (Browser code) | Run when the option is selected by the Web user. | Selection of option (Server code) | Run when the option is selected by the Web user. |
Remark: Only the browser codes are available in a static page. Dynamic programming of menu options The following WLanguage functions are used to dynamically handle the menu options of a page:
| | MenuAddMenu | Adds a new menu into a window or into a page. | MenuAddOption | Adds a new menu option at the end of a menu. | MenuAddPopup | Transforms a menu option of a page in order for this option to open a popup. | MenuAddSeparator | Adds a new separator into a menu. | MenuAddURLOption | Adds a new menu option at the end of a page menu. This menu option is used to display the page corresponding to the specified URL. | MenuDelete | Deletes a menu or a menu option. |
|
|
|
|