Hello guys, need a quick help here. Surely I am missing something.
I have a custom type and its CreateSub.
Then I have a map, with a key and this custom type filled with the propper variables as value
When I want to retrieve the values, I get the type (In debug i can see its contents and is correct), but when I want to assign the elements to variables I get an error
What am I missing here ?
THE ERROR
THE CODE THAT TRIGGERS THE ERROR ( lblAlertaDesde.Text = MapaFiltro.dataDesde)
THE TYPE
I have a custom type and its CreateSub.
Then I have a map, with a key and this custom type filled with the propper variables as value
When I want to retrieve the values, I get the type (In debug i can see its contents and is correct), but when I want to assign the elements to variables I get an error
What am I missing here ?
THE ERROR
B4X:
Error occurred on line: 4993 (AppDialogs)
java.lang.RuntimeException: Field: dataDesde not found in: java.lang.String
at anywheresoftware.b4a.shell.Shell$FieldCache.getField(Shell.java:923)
at anywheresoftware.b4a.shell.Shell.getField(Shell.java:697)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:360)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.shell.DebugResumableSub$RemoteResumableSub.resume(DebugResumableSub.java:22)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:137)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.agraham.dialogs.InputDialog$ExtendedBALayout$1.run(InputDialog.java:2467)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:247)
at android.app.ActivityThread.main(ActivityThread.java:8656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
THE CODE THAT TRIGGERS THE ERROR ( lblAlertaDesde.Text = MapaFiltro.dataDesde)
B4X:
If File.Exists(Starter.InternalFolder, "alertprefs.def") Then
ShareCode.FilterPreferences.Clear
Try
ShareCode.FilterPreferences = File.readMap(Starter.InternalFolder, "alertprefs.def")
If ShareCode.FilterPreferences.ContainsKey(alertType) Then
Dim MapaFiltro As FilterPreferences = ShareCode.FilterPreferences.Get(alertType)
lblAlertaDesde.Text = MapaFiltro.dataDesde
lblAlertaAte.Text = MapaFiltro.dataAte
butAlertDiarios.Checked = MapaFiltro.BotaoDia
butAlertSemana.Checked = MapaFiltro.BotaoSemana
butAlertMes.Checked = MapaFiltro.BotaoMes
butAlertDefinir.Checked = MapaFiltro.BotaoDefinir
DialogTypeAlert.SelectedIndex = MapaFiltro.TipoAlerta
DialogStatusAlert.SelectedIndex = MapaFiltro.EstadoAlerta
End If
Catch
Log(LastException)
End Try
End If
THE TYPE
B4X:
Type FilterPreferences (TipoAlerta As Int, EstadoAlerta As Int, dataDesde As String, dataAte As String, BotaoDia As Boolean, BotaoSemana As Boolean, BotaoMes As Boolean, BotaoDefinir As Boolean)
Public Sub CreateFilterPreferences (TipoAlerta As Int, EstadoAlerta As Int, dataDesde As String, dataAte As String, BotaoDia As Boolean, BotaoSemana As Boolean, BotaoMes As Boolean, BotaoDefinir As Boolean) As FilterPreferences
Dim t1 As FilterPreferences
t1.Initialize
t1.TipoAlerta = TipoAlerta
t1.EstadoAlerta = EstadoAlerta
t1.dataDesde = dataDesde
t1.dataAte = dataAte
t1.BotaoDia = BotaoDia
t1.BotaoSemana = BotaoSemana
t1.BotaoMes = BotaoMes
t1.BotaoDefinir = BotaoDefinir
Return t1
End Sub