Table Setup

After loading the database, the tables and views will be shown in the database pane on the left pane (database pane). Click on the [Tables] or [Views] or [Custom Views] or [Reports] node to go to the Table Setup page at any time.

Note: For simplicity, we use "table" in the following description to refer to any of database object in the project. A database object can be either a table, a view, a custom view or a report.

The Table Setup pages consists of two section. The upper section is a grid showing available options of all tables. The lower section contain two panels, the [Table-specific Options] panel and the [Master/Detail] panel for the selected table.

screen shot


Notes:

  1. For all checkbox or combobox columns, if you want to apply the setting to ALL tables or views, you can choose your setting at the [Tables] or [Views] or [Custom Views] or [Reports] row.
  2. View/Edit/Search functionality works at field level and can be setup for each field in the Field Level Setup page. Please refer to the Field Setup for details. If all fields are not selected for View/Edit/Search, the function will not be generated.

If you prefer to view the tables in alphabetical order, click [Tools]->[Sort Tables Alphabetically] (see Tools).

You can still change the display order of the menu item by drag-and-drop. Select a table by clicking the first column - [Table/View Name] column, then drag and drop to where you want. Note that a table cannot be moved out of its parent node.

Note that changing the display order of table in this Table Setup page does not change the display order of the tables in the menu. To change the display order of the menu item, click [Tools]->[Menu Editor] (see Tools).

IMPORTANT NOTES:

  1. It is assumed that all tables have primary key. (Composite key is supported.) If there is no primary key specified, View/Add/Copy/Delete/Edit/Update settings have no effect and will be reset to disabled when the [Generate] button is pressed. Only the List page can be generated. If you add back a primary key later, you'll need to come back to this page and re-enable them. Since reports are read-only, View/Add/Copy/Delete/Edit/Update settings are not applicable to reports.

  2. Views or Custom Views involving more than one table are usually NOT updatable. Although you can force ASP.NET Maker to enable the Add/Copy/Delete/Edit/Update pages by specifying a primary key, the generated pages will not work if these views or Custom Views cannot be updated like regular tables.

 

The available table level settings are as follows:

General

Generate Select/unselect a particular table for generation
Caption

To change the caption of a table, click on [Caption] box to make the necessary change.

Note: If you want to use special characters, use HTML entities such as "&#euro;", or you can enter unicode caption using Unicode Property Editor, see Tools for details.

Filter

Specify a filter (WHERE clause) for the table. Click the [...] button in [Filter] column, the Filter Editor will popup. Enter your filter, you can drag the field names from the left pane to the editor, the SQL identifier quote characters will also be added for you automatically.

Note: The filter must be a valid VB/C# string as the WHERE clause will be concatenated to the SQL string. For example, "State = 'CA'".

Sort

Specify the sort fields (ORDER BY clause) for the table. Click the [...] button in [Sort] column, the following dialog box will popup. You can choose up to 6 fields, in either ascending or descending order.

Default Set a Table as the Default Table. The Default table is the first table the user see when visiting your site. Select the table you want in the [Default] column.

 

List
Settings for List pages:

Inline Add

Enable/disable Inline Add function for the table. Inline Add allows users to add a record within the List page. Default is disabled.

Inline Copy Enable/disable Inline Copy function for the table. Inline Copy allows users to copy a record within the List page. Default is disabled.
Inline Edit Enable/disable Inline Edit function for the table. Inline Edit allows users to edit a record within the List page. Default is disabled.
Grid-Add

Enable/disable Grid-Add function for table. Allows users to add multiple records to the table. Default is disabled.

If the table is a detail table (in master/detail relationship), Enabling this option also enable Master/Detail-Add.

Note: From ASP.NET Maker 9, Grid-Add supports adding/deleting rows to/from the grid using JavaScript. Newer versions of browsers are required.

Grid-Edit

Enable/disable Grid-Edit function for table. Grid-Edit allows users to edit multiple records within the List page. Default is disabled.

If the table is a detail table (in master/detail relationship), Enabling this option also enable Master/Detail-Edit.

Note: From ASP.NET Maker 9, Grid-Edit supports adding/deleting rows to/from the grid using JavaScript. Newer versions of browsers are required.

Requires Search Criteria

Specifies if the List page requires search criteria. Default is disabled.

Notes:

  1. If enabled, the List page always requires search criteria. When the page is initially loaded, no records will be displayed until searching is done. (Remember to enable Quick Search, including Extended Quick Search, or Advanced Search or both. See below.)

  2. If a record is added but the new record does not meet the search criteria (or there is no search criteria yet), the record will not appear in the List page. So this option is best for tables which are for browsing only.
Detail Record Count

Specifies if the number of detail records for the master record should be displayed. Default is disabled.

Notes:

  1. Applicable to master tables with master/detail relationships defined in ASP.NET Maker only, see below.

  2. If the detail table is a report, this feature is NOT applicable, there will be NO detail record counts for the detail report.

  3. The counts are retrieved by using a subquery for each detail table. The more detail tables, the more performance penalty. You should enable this feature only if it is really required.

 

View

View

If enabled, a View page for the table will be generated (for displaying a record). Default is enabled.

Note: The table must have primary key or this setting will be unchecked during generation.

 

Add
Settings for Add pages:

Add

If enabled, an Add page for the table will be generated (for adding/copying a record). Default is enabled.

Note: The table must have primary key or this setting will be unchecked during generation.

Copy

If enabled, Add page will be generated and "Copy" links will be generated for record(s) in List/View page (for copying). Default is enabled. (If this setting is enabled, the "Add" setting is also enabled by default as copying requires the Add page.)

Note: The table must have primary key or this setting will be unchecked during generation.

CAPTCHA

Enable/disable CAPTCHA function for the Add page. Default is disabled. (CAPTCHA requires that the user type the letters or digits of a distorted image before submitting a form to prevent automated software from posting spam to your ASP.NET application.)

Notes:

  1. CAPTCHA function requires CAPTCHA extension, click Tools->Extensions from the main menu to enable. Also see Third-party Tools.
  2. CAPTCHA function is not applicable to Inline-Add/Copy.
Confirm

Enable/disable confirmation function for the Add page. Default is disabled. If enabled, there will be a confirmation step in the Add page, users will be able check their input before actually inserting the record.

Note: Confirmation function is not applicable to Inline-Add/Copy.

 

Edit

Edit

If enabled, an Edit page for the table will be generated (for updating a record). Default is enabled.

Note: The table must have primary key or this setting will be unchecked during generation.

CAPTCHA

Enable/disable CAPTCHA function for the Edit page. Default is disabled. (CAPTCHA requires that the user type the letters or digits of a distorted image before submitting a form to prevent automated software from posting spam to your ASP.NET application.)

Notes:

  1. CAPTCHA function requires CAPTCHA extension, click Tools->Extensions from the main menu to enable. Also see Third-party Tools.
  2. CAPTCHA function is not applicable to Inline-Edit.
Confirm

Enable/disable confirmation function for the Edit page. Default is disabled. If enabled, there will be a confirmation step in the Edit page, users will be able check their input before actually updating the record.

Note: Confirmation function is not applicable to Inline-Edit.

Check Conflicts

Check if the record is changed by other user before updating the record.

Notes:

  1. Since processing of current data for later comparison is required, using this feature will increase the time required to load the page. For better performance only the first hundreds of bytes of the BLOB fields are processed by default, but there are chances that change of BLOB data is not detected (if the first nth bytes are not changed). You can increase the number of bytes in Advanced Setting, if you want to process all bytes, enter 0.

  2. You can use the Row_UpdateConflict server event (see Server Events and Client Scripts) to resolve the conflicts according to your business logic by code.

 

Delete

Delete

If enabled, a Delete page for the table will be generated (for deleting record or multiple records). Default is enabled.

Note: The table must have primary key or this setting will be unchecked during generation.

 

Multi-Update

Multi-Update

If enabled, a Multi-Update page for the table will be generated (for updating multiple records). Default is disabled. With this feature you can select multiple records in the List page and update all records at the same time. You can select fields (see Field Setup page) to be included in the Multi-Update page.

Note: The table must have primary key or this setting will be unchecked during generation.

Confirm Enable/disable confirmation function for the Multi-Update page. Default is disabled. If enabled, there will be a confirmation step in the Multi-Update page, users will be able check their input before actually updating the selected records.

 

Search

Quick

If enabled, Quick Search panel (including Extended Quick Search) will be generated with the List page. Default is enabled.

Note: Quick Search searches text fields and optionally numeric fields only. These fields are selectable in Field Setup page. You may want to hide the Quick Search form for tables that do not have searchable fields.

Extended If enabled, Extended Quick Search inputs will be generated in the List page. Default is disabled.
Fields per Row For use with Extended Quick Search. Specifies the number of fields per row in the Quick Search panel. Default is 0 (unspecified), which means one field per row.
Advanced If enabled, an Advanced Search Page will be generated and linked to the List page. Default is disabled.
Highlight

If this setting is checked, the search criteria in the search result (List page) will be highlighted. Default is disabled.

Note: The highlight style can be modified by customizing the CSS stylesheet.


Audit Trail
To use this feature, you must also specify the [Audit Trail folder] or database table and field under [ASP]->[General Options] tab. See ASP.NET Setup for details.

Audit Trail

If audit trail for a table is enabled, when an user add/copy/edit/delete a record or login/logout, the related information will be logged in a log file or in a database table.

 

Email Notification
To use this feature, you must also specify the [Email Settings] under [ASP]->[Email Settings] tab. See ASP.NET Setup for details.

On Add

If enabled, when an user add a record, an email will be send to pre-set recipient email address(es). Default is disabled.

On Edit

If enabled, when an user edit a record, an email will be send to pre-set recipient email address(es). Default is disabled.

On Delete

If enabled, when an user delete a record, an email will be send to pre-set recipient email address(es). Default is disabled.

 

Table-specific Options

Multi-Page
Normally each field is displayed as a table row in the View/Add/Edit page, this Multi-Page features allow you to display divide the fields into pages and display only one page at a time. To enable, at least one field with page number larger than 1 must be set up in Field Setup page. Multi-Page is displayed as tabs in the generated scripts.

Page Labels

Specifies the page captions of each page in the Multi-Page. Click the [...] button and enter the page captions and click [OK] to save.

If page captions are not specified, "Page n" will be used by default. To add a page, go to Field Setup page, specify the page number for the fields in the page first.

Note: If you want to use special characters, use HTML entities such as "&#euro;", or you can enter unicode caption using Unicode Property Editor, see Tools for details. If you use multi-language project, you must use the Unicode Property Editor.

Add page

Specifies if Multi-Page is enabled for Add page.

Edit page

Specifies if Multi-Page is enabled for Edit page.

View page

Specifies if Multi-Page is enabled for View page.

Register page

Specifies if Multi-Page is enabled for register page. This setting is only available for the user table specified in Security Settings.

Return Pages

After Add

Specifies the return URL after a new record is added.

Note: The URL must be a valid VB/C# expression. If it is a string, it should be double quoted.

Example 1
If you want to redirect user to a custom page, enter:

"MyPage.aspx" (Note: Includes the double quotes).

Example 2
If you want to pass field values, enter: (e.g. VB)

"MyPage.aspx?xxx=" & ew_UrlEncode(<Table>.<Field>.DbValue)

e.g. "MyPage.aspx?ID=" & ew_UrlEncode(Cars.ID.DbValue)

Example 3
If you have just added a master record and want to go to Grid-Add page of the detail table, enter: (e.g. VB)

"<DetailTable>list.aspx?a=gridadd&showmaster=<Table>&<KeyField>=" & ew_UrlEncode(<Table>.<Field>.DbValue)

e.g. "OrderDetailslist.aspx?a=gridadd&showmaster=Orders&OrderID=" & ew_UrlEncode(Orders.OrderID.DbValue)

Example 4
If you have just added a master record and want to go to Add page of the detail table, enter: (e.g. VB)

"<DetailTable>add.aspx?showmaster=<Table>&<KeyField>=" & ew_UrlEncode(<Table>.<Field>.DbValue)

e.g. "OrderDetailsadd.aspx?showmaster=Orders&OrderID=" & ew_UrlEncode(Orders.OrderID.DbValue)

 

After Edit

Specifies the return URL after a record is edited.

Note: The URL must be a valid VB expression (or C# expression, depends on language setting of your project). If it is a string, it should be properly quoted. Also see examples above.

After Register

Specifies the return URL after an user is registered. This setting is only available for the user table specified in Security Settings.

Note: The URL must be a valid VB expression (or C# expression, depends on language setting of your project). If it is a string, it should be properly quoted. Also see examples above.

List/View Page Options
There options are same as the list page options as described in ASP.NET Setup except that the options are table-specific, meaning that you can have different list page options for different tables. To use table-specific options, select a table in the grid, uncheck [Use global settings] in the [Table-specific Options] panel, the panel will be enabled for you to setup.

 

 

Multiple Master/Detail
When you set up a master/detail relationship, you link two tables so that all the records of one table (the detail table) always correspond to the single current record in the other table (the master table). ASP.NET Maker (6+) supports multiple master/detail, which means that each table can have multiple master tables and details tables.

You can establish master/detail (one-to-many) relationship between two tables as follows

  1. Select a table in the table grid,
  2. Then in [Master/Detail] panel at the bottom right corner of the page, click [Modify...] to bring up the visual master/detail relationship editor.
  3. Click [Add table] to add the master and detail table to the diagram.
  4. Create a relationship between them by dragging from the master field (key field in master table) to the detail field (foreign key field in the detail table). If there are more linked field, repeat the step until all the relationships are setup.

If you want to remove a relationship, select the link in the diagram and click [Delete]. After setup, click [OK] to confirm.

Note: The diagram only shows master/detail relationships of the selected table. Although you can setup relationships for other tables in the diagram and view them in the [Master/Detail] panel immediately after clicking [OK], the relationships for other tables will not be loaded again if you go to other table and then come back to this table. Instead, the relationships will only be displayed when you change to the related tables.

In most cases, master and detail tables are joined by one field, you have one link between the master/detail table and you have one row in the Master/Detail panel only.

 

Also See:

Tutorial - Master/Detail

 

 


 
 ©2004-2011 e.World Technology Ltd. All rights reserved.