Sub button_click(Params As Map)
If Params.Size<1 Then Return
Dim event As String=Params.Get("name")
Log("aldb button click:"&event)
If event=Null Then Return
'
Dim ft1 As Future=alid.Getval
Dim ft2 As Future=alcn.Getval
Dim n1 As Int=ft1.Value
Dim s1 As String=ft2.Value
If Not(IsNumber(ft1.Value)) Then
Log("button_click alid:"&ft1.Value&", alcn:"&ft2.Value)
Return
End If
If event="load" Then
Dim s1 As String=aldb.loadAlarm(n1)
alcn.SetVal(s1)
ws.Flush
else if event="insert" Then
If ft2.Value=Null Then Return
CallSubDelayed3(aldb,"insertAlarm",n1,s1)
else if event="update" Then
If ft2.Value=Null Then Return
CallSubDelayed3(aldb,"updateAlarm",n1,s1)
else if event="delete" Then
aldb.deleteAlarm(ft1.Value)
End If
End Sub