'Code module "DatePickerModule"
Sub Process_Globals
Private pg As Page
End Sub
Public Sub Show
If pg.IsInitialized = False Then
pg.Initialize("pg")
pg.RootPanel.LoadLayout("DatePicker")
End If
Main.NavControl.ShowPage(pg)
Sleep(100)
Dim cd As CustomLayoutDialog
Dim p As Panel
p.Initialize("")
p.SetLayoutAnimated(0, 1, 0, 0, pg.RootPanel.Width - 40dip, 170dip)
p.LoadLayout("DatePicker")
cd.Initialize(p)
Wait For (cd.ShowAsync("Data acquisto caldaia...", "CONFERMA", "", "", False)) Dialog_Result(Result As Int)
If Result = cd.RESULT_POSITIVE Then
Dim dp As DatePicker = p.GetView(0) 'DatePicker is the first view in the layout
'Log($"Selected date: $Date{dp.Ticks}"$)
Dim df As String = DateTime.DateFormat
DateTime.DateFormat = "dd/MM/yyyy"
Dim res As String = DateTime.Date(dp.Ticks)
DateTime.DateFormat = df
Log ("Date = " & res)
Main.SelectedDate = res
End If
End Sub
'Main Module
Sub Process_Globals
Public App As Application
Public NavControl As NavigationController
Public SelectedDate As String
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
ProdRegistration
End Sub
Public Sub ProdRegistration
Dim j AsHttpJob
j.Initialize("j", Me)
j.PostString(WSUrl1, "")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Private WSResponse As String = j.GetString2("UTF8")
DatePickerModule.Show '>>> here is where I want to show the date picker and wait for the user response to get date
Private sDate As String = SelectedDate
End If
Dim j1 As HttpJob : j1.Initialize("j1", Me)
j1.PostString(WSUrl, WSParams)
Wait For (j1) JobDone(j1 As HttpJob)
If j1.Success Then
'........................
End Sub