diff --git a/webapp/containers/base/cntDatasourceBase.xojo_code b/webapp/containers/base/cntDatasourceBase.xojo_code index bff45a5..5f4b30a 100644 --- a/webapp/containers/base/cntDatasourceBase.xojo_code +++ b/webapp/containers/base/cntDatasourceBase.xojo_code @@ -54,9 +54,9 @@ Implements WebDataSource If (Me.Table = Nil) Then Return Nil Var rowIndex As Integer = Me.Table.SelectedRowIndex - If (rowIndex < 0) Then Return Nil + If (rowIndex < 0) Or (rowIndex > Me.TableRows.LastIndex) Then Return Nil - Return Me.Table.RowTagAt(rowIndex) + Return Me.TableRows(rowIndex).Lookup("rowtag", Nil) End Function #tag EndMethod @@ -198,7 +198,6 @@ Implements WebDataSource Var row As New WebListBoxRowData row.PrimaryKey = Me.TableRows(i).Lookup("id", -1).IntegerValue - row.Tag = dictRow For Each col As DatasourceColumn In Me.Columns Var colData As Variant = Me.TableRowColumnData(col, dictRow) @@ -227,6 +226,8 @@ Implements WebDataSource End Select Next + dictRow.Value("rowtag") = dictRowTag + row.Tag = dictRowTag rows.Add(row) @@ -439,6 +440,35 @@ Implements WebDataSource End Sub #tag EndMethod + #tag Method, Flags = &h1 + Protected Function TableRowFindAndSelect(findByFields As Dictionary) As Boolean + If (Me.TableRows = Nil) Or (Me.TableRows.LastIndex < 0) Then Return False + If (findByFields = Nil) Or (findByFields.KeyCount < 1) Then Return False + + Var tableRow As Dictionary + Var bAllFieldsFound As Boolean + For i As Integer = Me.TableRows.LastIndex DownTo 0 + tableRow = Me.TableRows(i) + + bAllFieldsFound = True + For Each field As Variant In findByFields.Keys + If (tableRow.Lookup(field.StringValue, "").StringValue <> findByFields.Value(field).StringValue) Then + bAllFieldsFound = False + Exit 'Loop matching Fields + End If + Next + + If (Not bAllFieldsFound) Then Continue 'searching next Table Row + + Me.Table.SelectedRowIndex = i + Return True + Next + + Return False + + End Function + #tag EndMethod + #tag Method, Flags = &h21 Private Function UnsortedPrimaryKeys() As Integer() // Part of the WebDataSource interface. diff --git a/webapp/containers/data/cntBackups.xojo_code b/webapp/containers/data/cntBackups.xojo_code index 8e68a1c..3029621 100644 --- a/webapp/containers/data/cntBackups.xojo_code +++ b/webapp/containers/data/cntBackups.xojo_code @@ -801,18 +801,12 @@ End Var sSelectAfterReload As String = esSelectAfterReload esSelectAfterReload = "" - Var bFound As Boolean = False - For i As Integer = Me.Table.LastRowIndex DownTo 0 - Var rowTag As Dictionary = Me.Table.RowTagAt(i) - If (rowTag IsA Dictionary) Then - If (rowTag.Lookup("timestamp", "-").StringValue <> sSelectAfterReload) Then Continue - Me.Table.SelectedRowIndex = i - bFound = True - Exit 'Loop - End If - Next + Var findByFields As New Dictionary + findByFields.Value("timestamp") = sSelectAfterReload - If (Not bFound) Then Me.Table.SelectedRowIndex = -1 + If (Not Me.TableRowFindAndSelect(findByFields)) Then + Me.Table.SelectedRowIndex = -1 + End If Me.RefreshButtons() diff --git a/webapp/containers/data/cntDatabases.xojo_code b/webapp/containers/data/cntDatabases.xojo_code index 42f27d8..2078d88 100644 --- a/webapp/containers/data/cntDatabases.xojo_code +++ b/webapp/containers/data/cntDatabases.xojo_code @@ -1145,18 +1145,12 @@ End Var sSelectAfterReload As String = esSelectAfterReload esSelectAfterReload = "" - Var bFound As Boolean = False - For i As Integer = Me.Table.LastRowIndex DownTo 0 - Var rowTag As Dictionary = Me.Table.RowTagAt(i) - If (rowTag IsA Dictionary) Then - If (rowTag.Lookup("databasename", "").StringValue <> sSelectAfterReload) Then Continue - Me.Table.SelectedRowIndex = i - bFound = True - Exit 'Loop - End If - Next + Var findByFields As New Dictionary + findByFields.Value("databasename") = sSelectAfterReload - If (Not bFound) Then Me.Table.SelectedRowIndex = -1 + If (Not Me.TableRowFindAndSelect(findByFields)) Then + Me.Table.SelectedRowIndex = -1 + End If Me.RefreshButtons() diff --git a/webapp/containers/data/cntSchedules.xojo_code b/webapp/containers/data/cntSchedules.xojo_code index ea7fe48..2b13697 100644 --- a/webapp/containers/data/cntSchedules.xojo_code +++ b/webapp/containers/data/cntSchedules.xojo_code @@ -933,18 +933,12 @@ End Var sSelectAfterReload As String = esSelectAfterReload esSelectAfterReload = "" - Var bFound As Boolean = False - For i As Integer = Me.Table.LastRowIndex DownTo 0 - Var rowTag As Dictionary = Me.Table.RowTagAt(i) - If (rowTag IsA Dictionary) Then - If (rowTag.Lookup("schedname", "").StringValue <> sSelectAfterReload) Then Continue - Me.Table.SelectedRowIndex = i - bFound = True - Exit 'Loop - End If - Next + Var findByFields As New Dictionary + findByFields.Value("schedname") = sSelectAfterReload - If (Not bFound) Then Me.Table.SelectedRowIndex = -1 + If (Not Me.TableRowFindAndSelect(findByFields)) Then + Me.Table.SelectedRowIndex = -1 + End If Me.RefreshButtons() diff --git a/webapp/containers/data/cntTablesIndexes.xojo_code b/webapp/containers/data/cntTablesIndexes.xojo_code index 31082e4..5267810 100644 --- a/webapp/containers/data/cntTablesIndexes.xojo_code +++ b/webapp/containers/data/cntTablesIndexes.xojo_code @@ -785,21 +785,13 @@ End Var sSelectAfterReload As Dictionary = edictSelectAfterReload edictSelectAfterReload = Nil - Var bFound As Boolean = False - For i As Integer = Me.Table.LastRowIndex DownTo 0 - Var rowTag As Dictionary = Me.Table.RowTagAt(i) - If (rowTag IsA Dictionary) Then - If (rowTag.Lookup("type", "").StringValue = sSelectAfterReload.Lookup("type", "-").StringValue) And _ - (rowTag.Lookup("name", "").StringValue = sSelectAfterReload.Lookup("name", "-").StringValue) Then - - Me.Table.SelectedRowIndex = i - bFound = True - Exit 'Loop - End If - End If - Next + Var findByFields As New Dictionary + findByFields.Value("type") = sSelectAfterReload.Lookup("type", "-").StringValue + findByFields.Value("name") = sSelectAfterReload.Lookup("name", "-").StringValue - If (Not bFound) Then Me.Table.SelectedRowIndex = -1 + If (Not Me.TableRowFindAndSelect(findByFields)) Then + Me.Table.SelectedRowIndex = -1 + End If Me.RefreshButtons() diff --git a/webapp/containers/information/cntClients.xojo_code b/webapp/containers/information/cntClients.xojo_code index b1024d7..2fe4d02 100644 --- a/webapp/containers/information/cntClients.xojo_code +++ b/webapp/containers/information/cntClients.xojo_code @@ -385,18 +385,12 @@ End Var iSelectAfterReload As Integer = eiSelectAfterReload eiSelectAfterReload = -1 - Var bFound As Boolean = False - For i As Integer = Me.Table.LastRowIndex DownTo 0 - Var rowTag As Dictionary = Me.Table.RowTagAt(i) - If (rowTag IsA Dictionary) Then - If (rowTag.Lookup("id", "").IntegerValue <> iSelectAfterReload) Then Continue - Me.Table.SelectedRowIndex = i - bFound = True - Exit 'Loop - End If - Next - - If (Not bFound) Then Me.Table.SelectedRowIndex = -1 + Var findByFields As New Dictionary + findByFields.Value("id") = iSelectAfterReload + + If (Not Me.TableRowFindAndSelect(findByFields)) Then + Me.Table.SelectedRowIndex = -1 + End If Me.RefreshButtons() @@ -434,7 +428,7 @@ End #tag Events btnRefresh #tag Event Sub Pressed() - Self.TableLoad() + Self.RefreshInfos() End Sub #tag EndEvent diff --git a/webapp/containers/security/cntEnginePreferences.xojo_code b/webapp/containers/security/cntEnginePreferences.xojo_code index 34eef63..155c4d2 100644 --- a/webapp/containers/security/cntEnginePreferences.xojo_code +++ b/webapp/containers/security/cntEnginePreferences.xojo_code @@ -789,23 +789,15 @@ End Var sSelectAfterReload As Dictionary = edictSelectAfterReload edictSelectAfterReload = Nil - Var bFound As Boolean = False - For i As Integer = Me.Table.LastRowIndex DownTo 0 - Var rowTag As Dictionary = Me.Table.RowTagAt(i) - If (rowTag IsA Dictionary) Then - If(rowTag.Lookup("engine", "").StringValue = sSelectAfterReload.Lookup("engine", "-").StringValue) And _ - (rowTag.Lookup("groupname", "").StringValue = sSelectAfterReload.Lookup("groupname", "-").StringValue) And _ - (rowTag.Lookup("databasename", "").StringValue = sSelectAfterReload.Lookup("databasename", "-").StringValue) And _ - (rowTag.Lookup("key", "").StringValue = sSelectAfterReload.Lookup("key", "-").StringValue) Then - - Me.Table.SelectedRowIndex = i - bFound = True - Exit 'Loop - End If - End If - Next - - If (Not bFound) Then Me.Table.SelectedRowIndex = -1 + Var findByFields As New Dictionary + findByFields.Value("engine") = sSelectAfterReload.Lookup("engine", "-").StringValue + findByFields.Value("groupname") = sSelectAfterReload.Lookup("groupname", "-").StringValue + findByFields.Value("databasename") = sSelectAfterReload.Lookup("databasename", "-").StringValue + findByFields.Value("key") = sSelectAfterReload.Lookup("key", "-").StringValue + + If (Not Me.TableRowFindAndSelect(findByFields)) Then + Me.Table.SelectedRowIndex = -1 + End If Me.RefreshButtons() diff --git a/webapp/containers/security/cntGroups.xojo_code b/webapp/containers/security/cntGroups.xojo_code index a633352..e23ba18 100644 --- a/webapp/containers/security/cntGroups.xojo_code +++ b/webapp/containers/security/cntGroups.xojo_code @@ -535,18 +535,12 @@ End Var sSelectAfterReload As String = esSelectAfterReload esSelectAfterReload = "" - Var bFound As Boolean = False - For i As Integer = Me.Table.LastRowIndex DownTo 0 - Var rowTag As Dictionary = Me.Table.RowTagAt(i) - If (rowTag IsA Dictionary) Then - If (rowTag.Lookup("groupname", "").StringValue <> sSelectAfterReload) Then Continue - Me.Table.SelectedRowIndex = i - bFound = True - Exit 'Loop - End If - Next - - If (Not bFound) Then Me.Table.SelectedRowIndex = -1 + Var findByFields As New Dictionary + findByFields.Value("groupname") = sSelectAfterReload + + If (Not Me.TableRowFindAndSelect(findByFields)) Then + Me.Table.SelectedRowIndex = -1 + End If Me.RefreshButtons() diff --git a/webapp/containers/security/cntPrivileges.xojo_code b/webapp/containers/security/cntPrivileges.xojo_code index 0e8d451..8c61354 100644 --- a/webapp/containers/security/cntPrivileges.xojo_code +++ b/webapp/containers/security/cntPrivileges.xojo_code @@ -765,23 +765,15 @@ End Var sSelectAfterReload As Dictionary = edictSelectAfterReload edictSelectAfterReload = Nil - Var bFound As Boolean = False - For i As Integer = Me.Table.LastRowIndex DownTo 0 - Var rowTag As Dictionary = Me.Table.RowTagAt(i) - If (rowTag IsA Dictionary) Then - If (rowTag.Lookup("groupname", "").StringValue = sSelectAfterReload.Lookup("groupname", "-").StringValue) And _ - (rowTag.Lookup("privilege", "").StringValue = sSelectAfterReload.Lookup("privilege", "-").StringValue) And _ - (rowTag.Lookup("databasename", "").StringValue = sSelectAfterReload.Lookup("databasename", "-").StringValue) And _ - (rowTag.Lookup("tablename", "").StringValue = sSelectAfterReload.Lookup("tablename", "-").StringValue) Then - - Me.Table.SelectedRowIndex = i - bFound = True - Exit 'Loop - End If - End If - Next - - If (Not bFound) Then Me.Table.SelectedRowIndex = -1 + Var findByFields As New Dictionary + findByFields.Value("groupname") = sSelectAfterReload.Lookup("groupname", "-").StringValue + findByFields.Value("privilege") = sSelectAfterReload.Lookup("privilege", "-").StringValue + findByFields.Value("databasename") = sSelectAfterReload.Lookup("databasename", "-").StringValue + findByFields.Value("tablename") = sSelectAfterReload.Lookup("tablename", "-").StringValue + + If (Not Me.TableRowFindAndSelect(findByFields)) Then + Me.Table.SelectedRowIndex = -1 + End If Me.RefreshButtons() diff --git a/webapp/containers/security/cntUsers.xojo_code b/webapp/containers/security/cntUsers.xojo_code index 7aaae56..66f54b9 100644 --- a/webapp/containers/security/cntUsers.xojo_code +++ b/webapp/containers/security/cntUsers.xojo_code @@ -889,18 +889,12 @@ End Var sSelectAfterReload As String = esSelectAfterReload esSelectAfterReload = "" - Var bFound As Boolean = False - For i As Integer = Me.Table.LastRowIndex DownTo 0 - Var rowTag As Dictionary = Me.Table.RowTagAt(i) - If (rowTag IsA Dictionary) Then - If (rowTag.Lookup("username", "").StringValue <> sSelectAfterReload) Then Continue - Me.Table.SelectedRowIndex = i - bFound = True - Exit 'Loop - End If - Next + Var findByFields As New Dictionary + findByFields.Value("username") = sSelectAfterReload - If (Not bFound) Then Me.Table.SelectedRowIndex = -1 + If (Not Me.TableRowFindAndSelect(findByFields)) Then + Me.Table.SelectedRowIndex = -1 + End If Me.RefreshButtons() diff --git a/webapp/containers/server/cntPlugins.xojo_code b/webapp/containers/server/cntPlugins.xojo_code index 53d7982..b59eec6 100644 --- a/webapp/containers/server/cntPlugins.xojo_code +++ b/webapp/containers/server/cntPlugins.xojo_code @@ -211,18 +211,10 @@ End Var sSelectAfterReload As String = esSelectAfterReload esSelectAfterReload = "" - Var bFound As Boolean = False - For i As Integer = Me.Table.LastRowIndex DownTo 0 - Var rowTag As Dictionary = Me.Table.RowTagAt(i) - If (rowTag IsA Dictionary) Then - If (rowTag.Lookup("name", "").StringValue <> sSelectAfterReload) Then Continue - Me.Table.SelectedRowIndex = i - bFound = True - Exit 'Loop - End If - Next + Var findByFields As New Dictionary + findByFields.Value("name") = sSelectAfterReload - If (Not bFound) And (Me.TableRows <> Nil) And (Me.TableRows.LastIndex >= 0) And (Me.Table.RowCount > 0) Then + If (Not Me.TableRowFindAndSelect(findByFields)) And (Me.TableRows.LastIndex >= 0) And (Me.Table.RowCount > 0) Then Me.Table.SelectedRowIndex = 0 End If diff --git a/webapp/main/LoginPage.xojo_code b/webapp/main/LoginPage.xojo_code index 64c1b82..ef7e99c 100644 --- a/webapp/main/LoginPage.xojo_code +++ b/webapp/main/LoginPage.xojo_code @@ -29,6 +29,7 @@ Begin WebPage LoginPage _ImplicitInstance= False _mDesignHeight = 0 _mDesignWidth = 0 + _mName = "" _mPanelIndex = -1 Begin WebRectangle rectLogin BackgroundColor = &cFFFFFF @@ -584,7 +585,7 @@ Begin WebPage LoginPage Enabled = True Height = 32 Index = -2147483648 - Indicator = "" + Indicator = 0 Left = 372 LockBottom = False LockedInPosition= True @@ -598,6 +599,7 @@ Begin WebPage LoginPage SVGColor = &c00000000 SVGData = "" TabIndex = 15 + TabPanelIndex = 0 TabStop = True Tooltip = "" Top = 440 @@ -634,8 +636,6 @@ Begin WebPage LoginPage Period = 50 RunMode = 0 Scope = 2 - TabIndex = 15 - TabStop = True _mPanelIndex = -1 End End @@ -929,7 +929,13 @@ End #tag Note, Name = DebugMemoryIssues - Place this in the Run Event of a WebThread (Location: Browser). + 1. Add a WebLabel + - Name: labMemory + - Multiline: True + 2. Add a WebTimer + - Location: Browser + 3. Copy and Paste the code below to the Run Event of the WebTimer + It'll show the count of instances. *****