Beside the display part of the Web Application, the input (editing) could
present a challenge of equivalent complexity. Editing attributes supported by
Tornado are -
- Single record editing with validation and calendar
- Full screen editing with validation and calendar
- Date input assistant - Popup Calendar
- System layout and user customized template layout of editing screens
- Notes
- ReadOnly Edit, ReadOnly No Edit, SelectBox LookUp, Hidden
- ReadOnly fields with MagicCell Filter.
- Validation client side - non-blank, logical, data range, regular
expression, pre-programmed masks (date, phone, SS, CreditCard, Number, email
etc..)
- Validation server side - data type, magic
- Auto data format recognition for different DBType = Access, MS-SQL, Oracle
and MySQL.
Standard System Edit Layout
|
<!--T_Edit_1.aspx--> <script
language='vb' runat='server'>
Sub Page_Load(Source as Object, E as EventArgs)
Dim Mydb As New Tornado.Z()
With Mydb
.dbQP = "Unit=2| Mode=Grid| Skin=plain| DSN=Nwind.Mdb|
TextHolder=Title=Basic Edit"
.dbSQL = "Select OrderID, CustomerID, EmployeeID,
OrderDate from Orders"
.dbBookMark = "Orders;0"
.dbNavigationItem = "prev,next,update"
.dbEditUpdateFlds = "Field=0|Type=RONOUPDATE,Field=1|Type=RONOUPDATE,Field=2|Type=RONOUPDATE,
3"
.ASPdbNET()
End With
End Sub
</script>
|
Only the OrderDate field is setup for edit, the rest are
displayed as ReadOnly reference field. Go ahead and edit the
Date field, the edit action will be rolled back as the DLL
is compiled in Demo mode which prohibit modifying the
database.
When edit inputs are submitted, all values will go
through a simple internal data type validation filter. So if
an invalid date type is entered in this case, an error
message will return and edit action will abort.
Edit Fields Input Assistants
Edit input assistants are the mechanisms we use to obtain accurate input
values. For example -
- Drop/select box will force the user to select from a list of valid values.
- Popup calendar will allow user to select a valid date format or a
valid date. A valid date can be a date within a date range or a date which is
allowed (non blocked out).
- Client side and Server side Data validation.
- Logical data validation.
|
<!--T_Edit_2.aspx--> <script
language='vb' runat='server'>
Sub Page_Load(Source as Object, E as EventArgs)
Dim Mydb As New Tornado.Z()
With Mydb
.dbQP = "Unit=2| Mode=Grid!sysind=t| Skin=plain|
DSN=Nwind.Mdb| TextHolder=Title=Basic Edit"
.dbSQL = "Select OrderID, CustomerID, EmployeeID,
OrderDate from Orders"
.dbBookMark = "Orders;0"
.dbNavigationItem = "prev,next,update"
.dbCommonTables = "index=EID,Full|sql=Select
employeeid, Firstname & ' ' & Lastname from employees"
.dbCalendar = "CalendarTitle(0)=Enter Order Date"
.dbEditUpdateFlds = "Field=0|Type=RONOUPDATE,Field=1|Type=RONOUPDATE,
Field=2|Type=SELECTBOX|
Value=EID| Text=Full, Field=3| Type=TextCalendar"
.ASPdbNET()
End With
End Sub
</script>
|
The above example presents the Employeeid field with a
SelectBox and the OrderDate field with a popup calendar to
assist the edit input. The popup calendar has 40+ properties
to configure the color, location, header, footer,
international dates formats, input mask. Each input text box
can have a separate popup calendar. For example, each popup
calendar can have a different title and block out date
range. This feature is unique to Tornado.
First we define the lookup dropdown common tables. The EmployeeID field is
converted to the SelectBox with the corresponding Value and Text values. All
need to be done is to define Field 2 is a Selectbox with Value and Text defined
by the Commontable's EID and Full index. As for the Popup calendar, just
define the field type as 'TextCalendar'. Now imagine the amount of code you have
to write to implement these.
Full Screen Edit with Popup calendar, Pre-programmed mask validation and
dropdown SelectBox
In order to demonstrate the power of the product without bring in the entire
Edit and Validation section of the manual, the following full screen update example packed a few of
the Editing Assistants just to illustrate how far you can go with Tornado. The
editing parameters are the same as a single record edit except that when
dbEditGridUpdate = True then it'll turn the editing into full screen mode.
Again, the demo has an edit rollback to suppress the real editing. You can see
the edit status before the rollback.
|
<!--T_Edit_3.aspx--> <script
language="vb" runat="server">
Sub Page_Load(Source as Object, E as EventArgs)
Dim EditAll As New Tornado.Z()
With EditAll
.dbQP="U=7| S=plain| M=Ty=Dh!Sys=t| D=Nwind.mdb|
Q=Employees| Gdf=0,1| ni=b5,update| Th=Tit=Full Screen Edit| BM=Employees;0"
.dbCommonTables = "ind=EID,First,FullName|sql=Select
employeeid,Firstname,Firstname & ' ' & Lastname from employees"
.dbLookUpFlds = "fi=EmployeeID|key=EID|look=FullName,fi=ReportsTokey=EID|look=FullName"
.dbEditGridUpdate = True
.dbValidatorParams = "code=/tornado/Jars|entry=false"
.dbEditUpdateFlds = "fi=0|ty=RONOUPdate,fi=HireDate|ty=TextCalendar|tag=size=6,fi=HomePhone|Ty=TEXT|tag=size=10|mask=USPHONE|event=both|req=true|err=Phone
Must be XXX-XXX-XXXX,fi=ReportsTo|ty=SELECTBOX|val=EID|tex=FullName,fi=Notes|ty=TextArea|tag=COLS=25
ROWS=5"
.ASPdbNET()
End With
End Sub
</script>
|