Using the screen template created earlier, we will create a menu screen.
Your user must be assigned the global variable NEXTMENU for this menu to work.
Xephr Menu Service for Standard Blocks
Select the Group Information object. Expand it, and select the group to which you wish to add the menu screen.
Right click on the group and select
Create ->Entity.
Click on the Screen
bullet.
Click on the Next button at the bottom right of the screen.
In the Entity Name property, type MENU as the entity name.
Leave the Datasource
property set to (use default), since there is only one datasource for
the Xephr
In the Based On property, select SCREEN_TEMPLATE, which is the template that we created earlier.
Set the Default Mode property to List View.
Leave the Body
Style, Editable Field
Style, Non-Editable Field Style,
Lov Style, and Link
Style properties set to (from parent), as these styles will be
taken from the SCREEN_TEMPLATE for this screen.
Click on the Next button at the bottom right of the screen.
In the Block Name property, enter MENUPAGE as the name of the block.
In the Block Type property, select Standard Block.
Set the Query Type property to Xephr Service.
Set the Datasource property to XEPHR_MENUS as this is the datasource that contains the menu information for Xephr.
In the Xephr Service property, select Xephr Menus.
Set the Create Heading checkbox to off to indicate that no heading should be created.
In the Mode Selection section, set the List checkbox to on. We will only have one block and mode for this screen.
In the Scheme
Selection section, select List
as we will be displaying multiple menu objects on the screen.
Click on the Next button at the bottom right of the screen.
The Constructing Xephr Service screen is displayed.
Click on the Field column header to select the Field checkbox for all columns.
Click on the Label
checkbox for the Display Text column only.
Click on the Next button at the bottom right of the screen.
The Ordering Fields
screen is displayed next. The columns are initially
ordered as they were listed on the previous screen. To
move a field up or down, highlight the desired field by selecting it,
and click on the Move Up or Move Down buttons on the right of the screen.
Move the fields until they are in the following
order:
DISPLAY_TEXT
MENU_NAME
ACTION_NAME
MENU_ORDER
TARGET_IS_MENU
NEW_PAGE
MODE
Click on the Next
button at the bottom of the screen to continue. The
Option to Add More screen is displayed.
We have no more blocks to add, so click on the
Finish button.
The new entity is added to the initially selected group.
In the Explorer
Tree, the new entity will be displayed, expanded with all blocks
shown.
Click on the Save button in the main toolbar to save the new screen entity.
Left click on the MENU entity to select it and double click to display the property sheet.
In the Title property, enter the text: Xephr Applications Menu.
Set the Display Only
property to true. The
menu screen does not allow modifications, so the fields all need to be
display only.
Left click on the LEFT_MENU block in the Explorer Tree and display the property sheet.
Set the On Edit,
On New, and On
QBE properties to false.
Expand the LEFT_MENU block in the Explorer Tree.
Hold down the Shift key and left click on each of the
following fields to select them.
QUERY
LIST
NEW
EXECUTE_SEARCH
SAVE
DELETE
CREATE
Click on the [Delete
Current] button to delete these links. None
of them are necessary on this screen.
When the Confirm Delete pop-up is displayed, select
Yes.
When the Delete Results message is displayed, select
Ok.
You'll get another set for each of the fields selected.
Click on the Save button in the main toolbar to save the changes.
In the Explorer Tree, expand the MENUPAGE_CONTAINER block. Then expand the MENUPAGE block.
Left click on the DISPLAY_TEXT field to select it. Double click to display the property sheet.
In the Hyperlink To
field, 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.:
if ( $$.TARGET_IS_MENU$$ == 'Y')
{
SetGlobalValue( 'NEXTMENU', $$.ACTION_NAME$$);
Show( 'MENU');
}
else
{
if ( $$.NEW_PAGE$$ == 'Y')
{
ShowInWindow($$.ACTION_NAME$$, $$.MODE$$, '600', '800', '0', '0');
}
else
{
ExecuteShow($$.MODE$$,$$.ACTION_NAME$$);
}
}
In the Explorer Tree, expand the MENUPAGE_HEADER block
Left click on the L_DISPLAY_TEXT field to select it and then display the property sheet.
In the Contents
field, enter Menu/Program.
Hold down the Shift key and left click on the following
fields to select them:
MENU_NAME
ACTION_NAME
MENU_ORDER
TARGET_IS_MENU
NEW_PAGE
MODE
Double click to 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.
Left click on the MENUPAGE block to select it and display the property sheet.
In the Param MENU_NAME
property, enter $$NEXTMENU$$. This global determines
which menu will be displayed on this block. It
is set at the user level, and then again when a menu is selected from
this block.
Click on the Save button in the main toolbar to save the changes.
Right click on the MENU entity and select Designer
Frame.
Hold down the Shift key and left click on the fields with the text Menu/Program and DISPLAY_TEXT in the Designer Tool.
Double click on the DISPLAY_TEXT field to display the Multi-Select property sheet.
In the Width
property, enter 300.
Click on the Save button in the main toolbar to save the changes.
Now the screen has been created, but no menus or menu links have been created.
In the Explorer Tree,
right click on the Menu Information
object and select Create->Menu.
The property sheet will be displayed for the new menu.
In the Menu Name property, enter MM.
In the Description
property and Display Text property,
enter Main Menu.
Click on the Save button in the main toolbar to save the new menu.
Now the main menu has been created, and we must add menu links to display on the main menu. There are two ways to do this. We are going to add two links, using both methods.
In the Explorer Tree, expand the REPORTS group.
Left click on the OPEN_INVOICES entity, right click
to display the menu, and select Add to
Menu.
The Create New MenuLink screen is displayed.
In the Select Parent Menu area, left click on the MM link to select the MM menu as the menu to which you are adding the report.
Leave the Default Mode property set to Parameter Form.
In the Display Text
property, enter Open Invoices by Customer. This
is the text that will be displayed on the menu.
Click on the Ok button.
The entity is expanded to display the menu link added
to the entity.
The Menu Information object and MM menu object are also
expanded so that you can see that it was added there as well.
Click on the Save button in the main toolbar to save the new menu link.
Right click on the MM menu to display the menu. Select
Create->Menulink.
In the Entity property, select the OPEN_INVOICE_TOTALS entity.
In the Z Order property, enter 10, so that this menu link will be displayed after the OPEN_INVOICES menu link.
In the Display Text property, enter Open Invoices with Totals.
Set the New Window property to true.
Leave the Execution
Mode property set to Parameter Form.
Click on the Save button in the main toolbar to save the new menu link.
Since the MENU screen is the default menu screen for the repository, we need to make sure it's assigned as the default Welcome Entity in the Repository Configuration.
Select the Repository Configuration object in the Explorer Tree and display the property sheet.
In the Welcome Entity
property, enter MENU.
Click on the Save button in the main toolbar.
To test the new screen entity, highlight it by selecting it, and click on the Run button in the main toolbar.
The Preparing to Run screen is displayed. Click
on the Run button.
The screen will be run in the browser.
Xephr is a registered trademark of NDS Systems, LC.
Copyright