-
Textcalendar field in update error
When having more that one update function on the same screen, the textcalendar field gives you an error if you try to select a date on whichever update function is used second.
Here is an example with northwind; just select update on the orders records and change the date using the calendar, now try to change the date on the employee record, it will give you an error. Wichever update is used first is the only one that will work subsequntly with the calendar and the only way to recover is to close and reopen explorer, refreshing the screen does not fix the error .
<script language="vb" runat="server">
Sub Page_Load(Source as Object, E as EventArgs)
Dim E61 As New Tornado.Z()
with E61
.dbUnit = 665
.dbSkin= "cappuccino"
.dbMode = "Grid"
.dbGridDisplayFlds = "0,1,2,3"
.dbDSN = "nwind"
.dbValidatorParams = "code=/tornado/Jars|entry=false"
.dbmemotextsize = 2048
.dbEditUpdateFlds = "fi=3|ty=textcalendar,1,2"
.dbEditAddFlds = "fi=3|ty=textcalendar,1,2"
.dbBookMark = "orders;0"
.dbNavigationItem ="top,bottom,next,prev,filter,reload,update,delete "
.dbSQL = "Select * from orders"
.dbTextHolder = "title=Orders"
.ASPdbNET()
End With
Dim E62 As New Tornado.Z()
with E62
.dbUnit = 666
.dbSkin= "cappuccino"
.dbMode = "Grid"
.dbGridDisplayFlds = "0,1,2,3,5"
.dbDSN = "nwind"
.dbValidatorParams = "code=/tornado/Jars|entry=false"
.dbmemotextsize = 2048
.dbEditUpdateFlds = "fi=5|ty=textcalendar,1,2,3,4"
.dbBookMark = "employees;0"
.dbNavigationItem ="top,bottom,next,prev,filter,reload,update,delete "
.dbSQL = "Select * from employees"
.dbTextHolder = "Title=Employees"
.ASPdbNET()
End With
End Sub
</script>
-
Look at dbMultiModules property description. Your setup is a stand alone case with a twist. There can be only one set of Calendar JS. So try to detect the active module at begining of the code and and knock out the "textcalendar" in the editflds properties to suppress generating duplicate JS setup for calendar.
FK
-
Try this ->
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim MyScript As String = Request.ServerVariables("SCRIPT_NAME")
Dim f As String = Request.QueryString("Tornado")
If Not IsNothing(f) Then f = Left(f, 4)
Dim E61 As New Tornado.Z()
With E61
.dbUnit = 665
.dbSkin = "cappuccino"
.dbMode = "Grid"
.dbGridDisplayFlds = "0,1,2,3"
.dbDSN = "nwind"
.dbValidatorParams = "code=/tornado/Jars|entry=false"
.dbMemoTextSize = 2048
If f = "_665" Then
.dbEditUpdateFlds = "fi=3|ty=textcalendar,1,2"
.dbEditAddFlds = "fi=3|ty=textcalendar,1,2"
End If
.dbBookMark = "orders;0"
.dbNavigationItem = "top,bottom,next,prev,filter,reload,update,del ete"
.dbSQL = "Select * from orders"
.dbTextHolder = "title=Orders"
.ASPdbNET()
End With
Dim E62 As New Tornado.Z()
With E62
.dbUnit = 666
.dbSkin = "cappuccino"
.dbMode = "Grid"
.dbGridDisplayFlds = "0,1,2,3,5"
.dbDSN = "nwind"
.dbValidatorParams = "code=/tornado/Jars|entry=false"
.dbMemoTextSize = 2048
If f = "_666" Then
.dbEditUpdateFlds = "fi=5|ty=textcalendar,1,2,3,4"
End If
.dbBookMark = "employees;0"
.dbNavigationItem = "top,bottom,next,prev,filter,reload,update,del ete"
.dbSQL = "Select * from employees"
.dbTextHolder = "Title=Employees"
.ASPdbNET()
End With
-
a better version ->
Dim GD As New Tornado.Getdata()
Dim f As String = GD.Get_Unit
Dim E61 As New Tornado.Z()
With E61
.dbUnit = 665
.dbSkin = "cappuccino"
.dbMode = "Grid"
.dbGridDisplayFlds = "0,1,2,3"
.dbDSN = "nwind"
.dbValidatorParams = "code=/tornado/Jars|entry=false"
.dbMemoTextSize = 2048
If f = "665" Then
.dbEditUpdateFlds = "fi=3|ty=textcalendar,1,2"
.dbEditAddFlds = "fi=3|ty=textcalendar,1,2"
End If
.dbBookMark = "orders;0"
.dbNavigationItem = "top,bottom,next,prev,filter,reload,update,del ete"
.dbSQL = "Select * from orders"
.dbTextHolder = "title=Orders"
.ASPdbNET()
End With
Dim E62 As New Tornado.Z()
With E62
.dbUnit = 666
.dbSkin = "cappuccino"
.dbMode = "Grid"
.dbGridDisplayFlds = "0,1,2,3,5"
.dbDSN = "nwind"
.dbValidatorParams = "code=/tornado/Jars|entry=false"
.dbMemoTextSize = 2048
If f = "666" Then
.dbEditUpdateFlds = "fi=5|ty=textcalendar,1,2,3,4"
End If
.dbBookMark = "employees;0"
.dbNavigationItem = "top,bottom,next,prev,filter,reload,update,del ete"
.dbSQL = "Select * from employees"
.dbTextHolder = "Title=Employees"
.ASPdbNET()
End With
-
I tried both methods and I get a compilation error on line 92.
Compiler Error Message: BC30289: Statement cannot appear within a method body. End of method assumed.
Source Error:
Line 90: #End ExternalSource
Line 91:
Line 92: Public Sub New()
Line 93: MyBase.New
Line 94: Dim dependencies As System.Collections.ArrayList
-
>>..Public Sub New()
where this come from ?
check line breaks. USe you old code that works and just add the few 'new' lines in there if stil have problem.
FK
-
Not sure either, but just pasting new lines in old code worked,
Thanks.
-
looks like a broken cut/paste line or header lines not correct...
FK
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|