In the following example, we will create a log in screen.
When creating a log in screen, the field for the user name must be XEPHR_USER and the field for the password must be XEPHR_PWD or the javascript code for logging in will not work.
Select the Group Information object. Expand it, and select the group to which you wish to add the new screen entity.
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 LOGIN as the entity name.
Leave the Datasource property set to (use default), since there is only one datasource for the Xephr install.
In the Based On property, select SCREEN_TEMPLATE, which is the template that we created earlier.
Leave the Default Mode property set to QBE 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 of the screen.
In the Block Name property, enter LOGIN_BLOCK as the name of the block.
In the Block Type property, select Standard Block.
Set the Query Type property to Not From Query.
Leave the Datasource property set to (use parent), since there is only one datasource for the Xephr install.
Set the Create Heading checkbox to on to indicate that a heading should be created for this block.
In the Mode Selection section, set the QBE checkbox to on as we only need one mode for this screen and it doesn't need to come from the database.
In the Scheme
Selection section, leave the Form
bullet set to on, since we want the fields displayed all in one block,
with the labels to the left of the fields.
Click on the Next button at the bottom of the screen.
The Adding Labels screen is displayed next. We need to add five fields to this block.
Click on the Add button five times.
In the newly added rows under the
Fields heading, enter the following
records:
L_XEPHR_USER
L_XEPHR_PWD
XEPHR_USER
XEPHR_PWD
LOGIN
Press the Enter key on the keyboard
after entering the last text.
Click on the Next button at the bottom of the screen.
The Option
to Add More Blocks screen is displayed next. We
have no more blocks or labels to add, so click on the Finish
button at the bottom of the screen.
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 entity.
The Login screen does not need a left menu, so we are going to delete it.
Left click on the LEFT_MENU block to select it.
Click on the Delete
button in the main toolbar to delete the block.
The Confirm
Delete pop up message will be displayed. Click
on Yes.
The Delete
Results pop up message will be displayed. Click
on Ok.
Click on the LOGIN entity and display the property sheet.
Set the Allow
Anonymous property to true.
This will allow users that are not logged in to
see the log in screen.
We need to make some modifications to the fields to allow the entry of the username, password, and to perform the login.
Expand the LOGIN_BLOCK.
Left click on the HEADING field in the Explorer Tree and display the property sheet.
In the Contents
property, enter Welcome to Xephr Applications.
Left click on the XEPHR_USER field in the Explorer Tree and display the property sheet.
In the Size property, enter 20.
Set the Display As property to Text.
Clear out the Contents property.
Set the Requests
Focus property to true because this is the field that you want
the cursor to be in when the screen loads.
Left click on the XEPHR_PWD field in the Explorer Tree and display the property sheet.
In the Size property, enter 20.
Set the Display As property to Password.
Clear out the Contents
property.
Left click on the L_XEPHR_USER field in the Explorer Tree and display the property sheet.
In the Contents
property, enter the text Enter User Name.
Left click on the L_XEPHR_PWD field in the Explorer Tree and display the property sheet.
In the Contents
property, enter the text Enter Password.
Left click on the LOGIN field in the Explorer Tree and display the property sheet.
Set the Display As property to Button.
Set the Field Style property to DEFAULT_BUTTON.
In the Contents property, enter the text Log In.
Scroll down, and in the On
Mouse Click property, enter DoLogin();
Click on the Save button in the main toolbar to save the changes.
Now we need to display the Designer Tool to correct the layout of the fields.
Right click on the LOGIN entity to display the menu.
Select Designer
Frame from the menu.
Within the Designer Tool, you can move, align, and resize the objects. For specific instructions on the Designer Tool and its functionality, see the Designer Tool section.
When the Designer
Tool is displayed, expand it so that you can see the entire entity.
The Designer Tool
displays the default mode of the entity selected. The
pop-list in the upper right of the Designer
Tool indicates that we are viewing the lay out of the QBE
Mode.
The HEADER field is not long enough to display all of the text. We need to stretch it to make it longer.
Left click on the field that displays Welcome to Xephr Applic... to select it.
Hold your cursor over the right
side of the field until it turns into a double headed arrow.
Left click and hold down the mouse
button. Then drag the cursor to the right until
all of the text is displayed in the field. Release
the mouse button.
Now, we are going to drag the XEPHR_USER field and the XEPHR_PWD field up to the right of their respective labels.
Hold down the Shift key on the keyboard,
and left click on the two blank fields beneath the HEADER field to select
them both.
Release the Shift key. Then
left click on one of the selected fields again and hold down the mouse
button. Drag your mouse down and to the right until
the fields are next to the labels beneath then.
Left click on the Log In field to de-select the selected fields and select the Log In field.
Hold down the mouse button and drag
the Log In field up to be below and centered with the user and password
fields.
Click on the Save button in the main toolbar to save the changes.
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 file will be run in the browser.
Xephr is a registered trademark of NDS Systems, LC.
Copyright