Xephr Menu Service for Standard Blocks

Runtime menus mimic the menu hierarchy set up in the Menu Information section of the Xephr studio.  When using a standard block that references the Xephr menu datasource, the root menu is defined according to a global value assigned to the user.  The navigation through the menu hierarchy is then controlled by resetting that global value and refreshing the screen in the browser.

See Also

Menu Objects

Cascading Menus

Menu Examples

Menu Operation for Xephr Menu Standard Blocks

Creating Standard Blocks using the Xephr Menu Service

Modifying Standard Blocks that use the Xephr Menu Service

Making the Menu Work

Menu Operation for Xephr Menu Standard Blocks

Once the menus and menu links have been created, and a menu screen has been set up with a menu block to display the menus and menu links, users can be set up to view the appropriate menus.  The user must have access to the menu screen.  

Example:

An example menu system operates as follows.

In the set of screens created, there is a main menu link on all entities that opens the menu screen.  Also, on the user's properties, in the Starting Page property, the entity name for the menu screen is entered.  When the user logs in, the menu screen is displayed and whenever the user goes to an entity, he/she can click on the Main Menu link on the entity to return to the menu screen.

The menu links that the user views on the menu screen is determined by the global variables assigned to the user object.  The globals are NEXTMENU and MAINMENU.  The menu block is set up to use the global value $$NEXTMENU$$ as the MENU_NAME parameter when the menu screen is run.  This parameter changes, depending on the movements of the user through the system.  Anytime a link needs to open the menu page, the $$NEXTMENU$$ global value may be different depending on the setting of the page.  

Alternatively, the MAINMENU global never changes.  When the user clicks on the Main Menu link of any screen, the NEXTMENU value is reset to be the user's main menu and the menu screen is reopened with that menu displayed.

Creating Standard Blocks using the Xephr Menu Service

  1. Create a screen or locate an existing screen to which you wish to add a menu block in the Explorer Tree.

  1. There are options in adding the block to the screen at this point.

  1. The Adding New Block screen will be displayed.

  2. In the Create block similar to pop-list, select (none).

  3. In the Block Name property, enter the name of the menu block.

  4. In the Block Type pop-list, select Standard Block.

  5. In the Query Type pop-list, select Xephr Service.

  6. In the Datasource property, select the datasource set up for Xephr Menus.

  7. In the Xephr Service property, select MenuQuery.

  8. Set the Create Heading flag to determine if a heading will be created for this block.  Set this flag to on to create a heading.  Set this flag to off if no heading should be created.

  9. Select the mode(s) in which this block will be displayed for this screen.  There are four flags here, one for each mode - QBE, List, Edit, New.  For each mode in which you wish the block to be displayed, set the flag to on.  For each mode in which you do not wish the block to be displayed, set the flag to off.

    It is recommended that either List or Edit mode be selected.

  10. Set the scheme for the new block to be List.

  11. Click the Next button in the bottom right of the screen to continue.

  12. The Constructing Xephr Service - Menu Query screen is displayed next.

  13. For each column, indicate whether the column will be included as a field on this block by setting the Field flag to on or off.

    To set the Field flag for all displayed columns, left-click once on the gray Field column header.

  14. For each column, indicate whether a label should be created for the field on this block by setting the Label flag to on or off.

    To set the Label flag for all displayed columns, left click once on the gray Label column header.

    You cannot set the Label flag to on unless the Field flag is also set to on for that column.

  15. It is recommended that all fields be selected, but only one label.  

  16. No key is required for this block.

  17. Click on the Next button in the bottom right of the screen to continue.

  18. The next step is to set up the order of the columns for the block. Using the Move Up and Move Down buttons, arrange the columns to be in the order that you wish them to be displayed on the block.

  19. It is recommended that Display Text is displayed first, followed by the other columns.

  20. Press the Next button at the bottom right of the screen to continue.

The block has been added.  Some modifications should be made to the block settings and to the fields on the block..

Modifying Standard Blocks that use the Xephr Menu Service

  1. In the Explorer Tree, locate the menu block that you wish to modify.

  1. Expand the screen and select the block that you wish to modify.

  2. Display the block properties.  These will either be displayed in Alphabetical or Logically, depending on the setting of the [Sort Alphabetically/Logically] button.  The following instructions are assuming that the properties are sorted logically.

  3. In the Name property, the name entered during block creation is displayed, and can be changed, if desired.

  4. In the Description property, enter the user-defined description for the block.

  5. In the Type pop-list, Standard Block is displayed and should not be changed.

  6. In the Query Type property, Xephr Service is displayed and should not be changed.

  7. In the Datasource property, your Xephr Menus datasource name is displayed and should not be changed.

  8. In the Table property, the MenuQuery is displayed and should not be changed.

  9. In the Param MENU_NAME property, enter the menu name that should be run when this menu block is displayed.  This value can be a static value, such as a menu name from the Menu Information section, or it can be a variable value, such as the global value $$NEXTMENU$$.  When the value is variable, the settings of the session will determine the menu displayed.

  10. In the Max Number of Rows property, enter the maximum number of rows that will be displayed on the screen for this block.  If this property is set to 0, the repository default will be used from the Default Screen Row Limit set up in the Repository Configuration.

    A block is considered a list if the max number of rows is not set to 1.

    Blocks are considered forms when the max number of rows is 1.

  11. Set the On QBE pop-list to true, if this block should be included in QBE mode for this screen.

  12. Set the On New pop-list to true, if this block should be included in New mode for this screen.

  13. Set the On List pop-list to true, if this block should be included in List mode for this screen.

  14. Set the On Edit pop-list to true, if this block should be included in Edit mode for this screen.

  15. Set the Display Only pop-list to the desired setting to indicate whether the data on this block be displayed as text only and cannot be modified.  

    When this pop-list is set to true, the data will be displayed as text only and cannot be modified.  

    When this pop-list is set to false, the data will be displayed as fields by default, but field level settings can override this.

    A list is considered to be editable if the block's Display Only pop-list is set to false.

  16. Set the Editability pop-list to the desired setting to indicate when this block is editable.  

    Always Editable: the data on this block will be displayed in form fields, and can be modified by default.  This setting can be overridden at the field level.

    Editable on New Only: the data on this block will be displayed in form fields and can be modified when the screen is in New mode only, by default.  This setting can be overridden to Never Editable at the field level.

    Never Editable: the data on this block will be displayed in form fields, but cannot be modified.

  17. Set the Body Style pop-list to the style to be applied to the body for this block.  If set to (from parent), the style used will be the Body Style from the screen properties.

  18. Set the Editable Field Style pop-list to the style to be applied by default to the editable fields for this block.  If set to (from parent), the style used will be the Editable Field Style from the screen properties.

  19. Set the Non-Editable Field Style pop-list to the style to be applied by default to the display only and label fields for this block.  If set to (from parent), the style used will be the Non-Editable Field Style from the screen properties.

  20. Set the Link Style pop-list to the style to be applied to hyperlinks for this block.  If set to (from parent), the style used will be the Link Style from the screen properties.

  21. In the X property, the location in pixels is displayed for the top left corner of this block or field on the X-axis (horizontal) of the layout screen.  You can change this number manually, or it will be changed when you are altering the layout with the Designer Tool.

  22. In the Y property, the location in pixels is displayed for the top left corner of this block or field on the Y-axis (vertical) of the layout screen.  This value is used in conjunction with the Y Anchor Type setting.  You can change this number manually, or it will be changed when you are altering the layout with the Designer Tool.

  23. In the Y Anchor Type pop-list, select the anchor type for this block.  Choices are Fixed and Relative to Block..

  1. In the Y Anchor property, select the block or field that will be used to determine the location of the block on the Y-axis.  The property is only displayed when the Y Anchor Type pop-list is set to Block or Field.

  2. In the Width property, enter the width for the block in pixels.

  3. In the Height property, enter the height for the block in pixels.

  4. In the Expand Type pop-list, define the size of the block.  Choices are Expandable, Fixed No Scroll Bars, and Fixed with Scroll Bars.

  1. In the Hide If property, enter the conditions under which this block will be hidden.  The field will be visible on the block when the conditions are met.  When an entry is made in this property, the Show If property will be hidden.

  1. In the Show If property, enter the conditions under which this block will be displayed.  The block will be hidden when the conditions are met.  When an entry is made in this property, the Hide If property will be hidden.

  1. In the Show if Empty pop-list, determine whether the block will be displayed when it is empty.  When set to true, the block will be displayed on the screen even when it contains no data.  When set to false, the block will be hidden when it contains no data.

  2. In the Z Order property, enter a number to define the order in which the block will be generated on the entity.  The higher the number, the later the block will be generated.  The Z order is specific to the indention level in the entity tree, and is affected by the Y Anchor and Anchor Type properties.   
    For blocks with a Tab Block as the parent block, this number determines in which order the tabs will be displayed within the tab block.  

  3. In the Commit Order property, enter a number to define the order in which the data in the block will be committed when the record is saved.  The higher the number, the later the block will be saved.

  4. The Created on property displays the date and time on which this block was created and cannot be changed.

  5. The Modified on property displays the date and time on which this block was last changed and cannot be modified.

  6. When all changes have been made, press the [Save] button in the Main Toolbar.

  7. Make any layout changes with the Designer Tool.

Making the Menu Work

The final changes for this menu include hiding the fields that you do not need to see and creating the link that actually runs the menu.  The following instructions assume that you are using a global value to determine the menu that is displayed and that the global is called NEXTMENU.  This value should have been entered in the block's Param MENU_NAME property as $$NEXTMENU$$.

  1. In the Explorer Tree, find the DISPLAY_TEXT field and display the property sheet.

  2. In the Hyperlink To property, enter the following text.  

    This code says that if the target_is_menu field for the record is Y, when the user clicks on the link, reopen the menu screen with displaying the new menu, otherwise, if the new_page field for the record is set to Y, when the user clicks on the link, open the entity in a new screen in its default mode.  Otherwise, open the entity in this screen, in its default mode.  Replace <your menu entity name> with the name of the entity containing the menu.
    if ( $$.TARGET_IS_MENU$$ == 'Y')
    {
    SetGlobalValue( 'NEXTMENU', $$.ACTION_NAME$$);
    Show( '<your menu entity name>');
    }
    else
    {
    if ( $$.NEW_PAGE$$ == 'Y')
    {
    ShowInWindow($$.ACTION_NAME$$, $$.MODE$$, '600', '800', '0', '0');
    }
    else
    {
    ExecuteShow($$.MODE$$,$$.ACTION_NAME$$);
    }
    }

  3. Find the label that you created when you created the block and modify its text as desired.

  4. In the menu block (where the DISPLAY_TEXT field is), hold down the shift key on the keyboard and click on the remaining fields to select them.

  5. Display the multi-select property sheet and set the Visible property to false.  We do not need to display any of these fields on the screen.

  6. Make any additional field or layout changes.

  7. Click on the Save button in the main toolbar to save the changes.

Xephr is a registered trademark of NDS Systems, LC.

Copyright © 2007 NDS Systems LC.