Is it possible to use another DatePicker control in a Dialog2 dialog?
I created a layout on which I added anotherDatePicker control. When the dialog is displayed, I receive the following message:
To open the dialog I use the following code:
I created a layout on which I added anotherDatePicker control. When the dialog is displayed, I receive the following message:
B4X:
Error occurred on line: 156 (AnotherDatePicker)
java.lang.RuntimeException: Object should first be initialized (B4XView).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.objects.B4XViewWrapper.getViewObject(B4XViewWrapper.java:101)
at anywheresoftware.b4a.objects.B4XViewWrapper.getColor(B4XViewWrapper.java:399)
at isorihner.softxxi.anotherdatepicker._datefield_textchanged(anotherdatepicker.java:621)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
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.objects.EditTextWrapper$1.afterTextChanged(EditTextWrapper.java:83)
at android.widget.TextView.sendAfterTextChanged(TextView.java:10991)
at android.widget.TextView.setText(TextView.java:6431)
at android.widget.TextView.setText(TextView.java:6231)
at android.widget.EditText.setText(EditText.java:146)
at android.widget.TextView.setText(TextView.java:6188)
at android.widget.TextView.setTransformationMethod(TextView.java:2814)
at android.widget.TextView.applySingleLine(TextView.java:10651)
at android.widget.TextView.setSingleLine(TextView.java:10625)
at anywheresoftware.b4a.objects.EditTextWrapper.setSingleLine(EditTextWrapper.java:140)
at isorihner.softxxi.anotherdatepicker$ResumableSub_DesignerCreateView.resume(anotherdatepicker.java:802)
at isorihner.softxxi.anotherdatepicker._designercreateview(anotherdatepicker.java:744)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
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.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:61)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
at isorihner.softxxi.arhivaoferte$ResumableSub_Amanare_Click.resume(arhivaoferte.java:915)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
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$DelegatableResumableSub.resume(DebugResumableSub.java:43)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:137)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.agraham.dialogs2.InputDialog$ExtendedBALayout$1.run(InputDialog.java:2536)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7266)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
To open the dialog I use the following code:
B4X:
Dim sf As Object = DialogAmanareStergere.ShowAsync("Amanare / refuzare oferta", "Ok", "Cancel", "", Null, True)
Dim w As Int = 100%x
Log(100%x & " Wide, " & 100%y & "High")
If 100%Y < 100%x Then w = 100%y
DialogAmanareStergere.SetSize(w, 350dip)
Wait For (sf) Dialog_Ready(pnl As Panel)
pnl.LoadLayout("DialogAmanareStergereLayout")
Dim first As Long = DateUtils.SetDate(DateTime.GetYear(DateTime.Now), DateTime.GetMonth(DateTime.Now),1)
DataAmanare.Date = first