Using the screen template created earlier, we will create a Basic Drag Drop type screen for assigning sales representatives to customers.
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 CUSTOMER_REP 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 set to Edit View. We will only have one mode for this screen.
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.
Our first block is going to act as a heading block for the Basic Drag Drop that we are creating, listing the sales representative names.
In the Block Name property, enter SLSMAN as the name of the block.
In the Block Type property, select Standard Block.
Set the Query Type property to Simple Query.
Leave the Datasource property set to (use parent).
In the Table property, select the name of the table or view from which the data will be obtained. Since our datasource is set to use the Oracle 9i database for NDS Applications, we will select the view SLSMASTER_UVW.
Set the Create Heading checkbox to off as we do not want a heading for this block.
In the Mode Selection section, leave the Edit flag set to on.
In the Scheme
Selection section, set the Form
bullet to on.
Click on the Next button at the bottom of the screen to continue.
The Adding Fields screen is displayed. Select the columns that you wish to include on the screen.
Set the Key Required flag to off as we are just using this block to display the information from the database and will not be manipulating it on this screen.
In the Filters
property, you could enter code to restrict the data returned from the
table. We need to restrict the sales representatives
returned to those that will be displayed in the Basic Drag Drop block.
Enter the following in this property.
where slsman in (select slsman from cust_rep_uvw) and org_unit_id =
$$ORG_UNIT_ID$$
In the Ordering and
Grouping property, you can enter code to determine the order in
which the data is displayed in the screen. We want
the sales representatives to be listed in alphabetical order by sales
representative ID, so the following should be entered:
order by slsman
Click on the Next button at the bottom 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:
SLSMAN
SLSNAME
Click on the Next button at the bottom of the screen.
The Option to Add More
screen is displayed. We need to create a header
block next. Set
the Add Block or Labels
checkbox to on. The entity in its current form
will be displayed.
Click on the CUSTOMER_REP entity to select it.
Click on the Add Block button to continue.
In the Block Name property, enter CUST_REP as the name of the block.
In the Block Type property, select Basic Drag Drop.
Set the Query Type property to Simple Query.
Leave the Datasource property set to (use parent).
In the Table property, select CUST_REP_UVW.
In the Number of Containers property, enter 8. This is the total number of containers that will be displayed in the drag drop block, between which the records can be moved.
In the Container ID Column property, select S_CTR. This is the column from the view that determines in which container the record will be placed when the block is loaded.
In the X Column property, select S_X. This is the column from the view that stores the location of the record in pixels on the X axis (horizontal) of the container.
In the Y Column property, select Y_X. This is the column from the view that stores the location of the record in pixels on the Y axis (vertical) of the container.
Leave the Collapsible property set to on to indicate that the detail block can be either collapsed and hidden or expanded and displayed at runtime, by the user.
Leave the Initial State property set to Collapsed to indicate the when the records are loaded, the detail block will be collapsed and hidden for each record.
In the Mode
Selection section, leave the Edit
checkbox set to on.
The Adding Fields screen is displayed. Select the columns that you wish to include on the screen.
Set the Key flag to on for the SLSMAN and CUST_NO fields.
Set the Header flag to on for the CUST_NAME, CUST_NO, and SLSMAN field. Columns with this flag selected will be displayed in the header section of each record.
Set the Detail
flag to on for the following fields.
Columns with this flag selected will be displayed
in the detail section of each record.
STATE
SLS_LOCATION
SLS_TERRITORY
CITY
SLS_NAME
SLS_REGION
Set the Label
flag to on for the following fields:
STATE
SLS_LOCATION
SLS_TERRITORY
CITY
SLS_NAME
SLS_REGION
In the Filters property, you could enter code to restrict the data returned from the table. We do not need to restrict the data returned from the view, so leave this property empty.
In the Ordering and
Grouping property, you can enter code to determine the order in
which the data is displayed in the screen. We want
the records to be listed in order by customer name, so the following should
be entered:
order by cust_name
Click on the Next button at to the bottom 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:
CUST_NO
CUST_NAME
SLSMAN
CITY
STATE
SLS_LOCATION
SLS_NAME
SLS_TERRITORY
SLS_REGION
Click on the Next button at to the bottom of the screen.
The Option to Add More
screen is displayed. We have no more blocks or
labels 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.
Now we need to make sure that the correct links are showing up on this screen.
In the Explorer Tree, click on the LEFT_MENU block to select it, and double click to display the Property Sheet. Since we only have one mode for this screen, we need to modify this block so it is only displayed in that mode.
Set the On QBE,
On New, and On
List properties to false.
Expand the LEFT_MENU block in the Explorer Tree.
Hold down the Ctrl key on the keyboard, and left click
on the following fields to select them as a group.
QUERY
LIST
NEW
EXECUTE_SEARCH
DELETE
CREATE
Double click on the CREATE field to display the Multi-Select
Property Sheet. Set the On
Edit property to false.
Click on the Save button in the main toolbar to save the changes.
In the Explorer Tree, left click on the CUST_REP_CONTAINER field to select it. Double click to display the Property Sheet.
Verify that the Number of Containers property is set to 8.
There are additional properties here that can be modified for the display and edit of the Basic Drag Drop block.
Leave the Read Only
Containers property blank. None of our containers
are read only.
Records in read only containers cannot be dragged from the container
and dropped into another container. In addition,
records from other containers cannot be dropped into a read only container.
Leave the Content Constraint List property blank. None of our containers have a limit on the number of records that it can contain.
Leave the Container
Widths property blank. All of our containers
are the same width relative to one another.
The container widths are relative to the values that you enter here
and the width defined for the block. The values
entered are added up and the width of the block is divided by that value,
then the appropriate width is applied to each container. If
no values are entered here, all columns are assumed to be the same width.
The Top Margin (in Pixels) property indicates the number of pixels in the margin between the top of the container and the top of the first record in the container.
The Left Margin (in Pixels) property indicates the number of pixels in the margin between the left side of the container and the left side of the record in the container.
The Horizontal Padding (in Pixels) property indicates the number of pixels in between records horizontally within a container.
The Vertical Padding
(in Pixels) property indicates the number of pixels in between
records vertically within a container.
Click on the Save button in the main toolbar to save the changes.
In the Explorer Tree, right click on the CUSTOMER_REP
entity and 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.
We only want the SLS_NAME displayed in the SLSMAN_HEADER block, and we want it repeated horizontally so that it will top the containers below it.
Left click on the SLSMAN field and double click to display the property sheet.
Set the Visible
property to false.
In the Designer Tool, left click on the SLS_NAME field
and drag it up and to the left to line it up with the top and left side
of its block.
Left click to the right of the SLS_NAME field to select its block and double click to display the Property Sheet.
In the Wrap at Column property, enter 8, which is the same as the number of containers in the view.
In the Width field, enter 255.
In the Height
field, enter 21.
Click on the Save button in the main toolbar to save the changes.
The Basic Drag Drop block needs to stretch from the
left side of the screen to the right side of the screen, so we need to
move the LEFT_MENU block so that it stretches across the top of the screen,
with the SLSMAN block below it, and the Basic Drag Drop block below that.
Move around the fields and blocks in the Designer
Tool until they look like this:
Now we need to modify the Basic Drag Drop block and its fields.
In the Designer Tool, change the View
pop-list to CUST_REP_CONTAINER. Basic Drag Drop
blocks have a separate Designer Tool view.
Size the Designer Tool so that you can see the entire block.
First, we need to hide the SLSMAN field for the block. Double click on the SLSMAN field in the header to display the property sheet.
Set the Visible
property to false.
Now we need to resize the top block. Left
click below the CUST_NAME field to select the block. Hold your mouse over
the bottom side of the block until it turns into a double headed arrow.
Hold down the left mouse button and drag the side
of the block up until it lines up with the bottom side of the CUST_NAME
field.
Hold down your Ctrl key on the keyboard, and left click
on the following fields. Double click to display
the Multi-Select Property Sheet.
City
State
Sls Location
Sls Name
Sls Territory
Sls Region
In the Width
property, enter 60.
Hold down your Ctrl key on the keyboard, and left click
on the following fields. Holding down your left
mouse button drag the fields up until they are lined up to the right of
the label fields.
CITY
STATE
SLS_LOCATION
SLS_NAME
SLS_TERRITORY
SLS_REGION
The SLS_NAME field needs to be shrunken a little. Double click on it to display the Property Sheet.
In the Width
property, enter 140.
Now we need to shrink the block. Left
click on the lower block to select it. Hold your
mouse over the right side of the block until it turns into a double headed
arrow. Hold down the left mouse button and drag
the side of the block to the left until it lines up with the right side
of the SLS_NAME field. Notice that the header block
is also resized in this way.
The CUST_NAME and CITY fields ended up being a little
too long. Click on each one to select it. Then,
click on the right edge of the field and drag it to fit within the block.
Now shrink the bottom of the lower block until it ends
right below the Sls Region field.
Hold down your Ctrl key and select the CUST_NO and CUST_NAME fields in the header. We do not want these fields to be modified on this screen. Display the Multi-Select property sheet.
Set the Display As
property to Label.
Click on the Save button in the main toolbar to save the changes.
Some final changes are necessary to clean up the screen so that it looks nice.
Left click on the CUSTOMER_REP entity and double click to display the property sheet.
In the Title field, enter Customer Sales Representative Management.
Right now, if you tried to run the screen, all of the columns would be bunched up, not able to fit within the space allotted. We need to make more space so that the fields can all be viewed.
In the Width
field, enter 2000.
Left click on the CUSTOMER_REP_CONTAINER block and display the Property Sheet.
In the Width
field, enter 2000.
Now, left click on the SLSMAN block and display the Property Sheet.
Set the Display Only
property to true.
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. Since
a global variable was defined in the Filtering property, you must define
the value before the screen is run. Enter 100 in
the value field and press the
Run button.
The screen will be run in the browser.
Xephr is a registered trademark of NDS Systems, LC.
Copyright