Sub Page_ParseEvent(Params As Map)
ABMShared.ParseEvent(Me, page, ABMPageId, Params, Name)
End Sub
' in module ABMShared:
public Sub ParseEvent(self As Object, Page As ABMPage, ABMPageID As String, Params As Map, Name As String)
Dim eventName As String = Params.Get("eventname")
Dim eventParams() As String = Regex.Split(",",Params.Get("eventparams"))
'Log(eventName)
If eventName = "beforeunload" Then
'Log(FormatDateTimeNow(Name) & "preparing for url refresh")
ABM.RemoveMeFromCache(CachedPages, ABMPageID)
Return
End If
Dim caller As Object = Page.GetEventHandler(self, eventName)
If caller = self Then
If SubExists(self, eventName) Then
Params.Remove("eventname")
Params.Remove("eventparams")
If eventName = "page_dropped" Then
Page.ProcessDroppedEvent(Params)
End If
Select Case Params.Size
Case 0
CallSub(self, eventName)
Case 1
CallSub2(self, eventName, Params.Get(eventParams(0)))
Case 2
If Params.get(eventParams(0)) = "abmistable" Then
Dim PassedTables As List = ABM.ProcessTablesFromTargetName(Params.get(eventParams(1)))
CallSub2(self, eventName, PassedTables)
Else
CallSub3(self, eventName, Params.Get(eventParams(0)), Params.Get(eventParams(1)))
End If
Case Else
' cannot be called directly, to many param
CallSub2(self, eventName, Params)
End Select
End If
Else
CallSubDelayed2(caller, "ParseEvent", Params) 'ignore
End If
End Sub