I want to show AnotherDatePicker in OK Cancel dialog, i used code below to do this, but i get an error message, any ideas?
thanks
** Activity (main) Pause, UserClosed = false **
** Activity (triporders) Create, isFirst = true **
** Activity (triporders) Resume **
Error occurred on line: 150 (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 b4a.example.anotherdatepicker._datefield_textchanged(anotherdatepicker.java:574)
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:8526)
at android.widget.TextView.setText(TextView.java:4595)
at android.widget.TextView.setText(TextView.java:4443)
at android.widget.EditText.setText(EditText.java:89)
at android.widget.TextView.setText(TextView.java:4418)
at android.widget.TextView.setTransformationMethod(TextView.java:2023)
at android.widget.TextView.applySingleLine(TextView.java:8207)
at android.widget.TextView.setSingleLine(TextView.java:8182)
at anywheresoftware.b4a.objects.EditTextWrapper.setSingleLine(EditTextWrapper.java:140)
at b4a.example.anotherdatepicker$ResumableSub_DesignerCreateView.resume(anotherdatepicker.java:754)
at b4a.example.anotherdatepicker._designercreateview(anotherdatepicker.java:697)
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 anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout(B4XViewWrapper.java:311)
at b4a.example.triporders$ResumableSub_lblTripOrdersPickDateMove_Click.resume(triporders.java:1250)
at b4a.example.triporders._lbltriporderspickdatemove_click(triporders.java:1206)
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.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5647)
at android.view.View$PerformClick.run(View.java:22465)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6577)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:986)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)
thanks
B4X:
Sub lblTripOrdersPickDateMove_Click
Dim DateDialog As B4XDialog
DateDialog.Initialize(Activity)
DateDialog.Title = "Pick Date Move"
DateDialog.PutAtTop = True
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 50%x, 50%y,90%x, 34%y)
p.LoadLayout("datepickerdialog")
Wait For (DateDialog.ShowCustom(p, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
lblTripOrdersDateMove.Text = datpDatePicker.Date
Else
Return
End If
End Sub
** Activity (main) Pause, UserClosed = false **
** Activity (triporders) Create, isFirst = true **
** Activity (triporders) Resume **
Error occurred on line: 150 (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 b4a.example.anotherdatepicker._datefield_textchanged(anotherdatepicker.java:574)
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:8526)
at android.widget.TextView.setText(TextView.java:4595)
at android.widget.TextView.setText(TextView.java:4443)
at android.widget.EditText.setText(EditText.java:89)
at android.widget.TextView.setText(TextView.java:4418)
at android.widget.TextView.setTransformationMethod(TextView.java:2023)
at android.widget.TextView.applySingleLine(TextView.java:8207)
at android.widget.TextView.setSingleLine(TextView.java:8182)
at anywheresoftware.b4a.objects.EditTextWrapper.setSingleLine(EditTextWrapper.java:140)
at b4a.example.anotherdatepicker$ResumableSub_DesignerCreateView.resume(anotherdatepicker.java:754)
at b4a.example.anotherdatepicker._designercreateview(anotherdatepicker.java:697)
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 anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout(B4XViewWrapper.java:311)
at b4a.example.triporders$ResumableSub_lblTripOrdersPickDateMove_Click.resume(triporders.java:1250)
at b4a.example.triporders._lbltriporderspickdatemove_click(triporders.java:1206)
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.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5647)
at android.view.View$PerformClick.run(View.java:22465)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6577)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:986)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)