Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public pg As Page
Public DraftsListView As CustomListView
End Sub
Sub Show
If Not(pg.IsInitialized) Then
DraftsListView.Initialize(Me, "DraftsListView", 100%x)
pg.Initialize("page")
'this is an empty layout with just the title set
'i have also tried to not use this layout at all but doesnt make a difference
pg.RootPanel.LoadLayout("AvailableDrafts")
End If
Main.NavControl.ShowPage(pg)
End Sub
.....
'this sub is called from the main page on an event
Sub LoadDraftsInListView
'i have moved the first two lines here because this is when i at least
'get the CLV to take up correct size the first time. originally i just placed the AddView
'in the initialization above and didn't use RemoveAllViews at all
'but that always resulted in a small CLV
pg.RootPanel.RemoveAllViews
pg.RootPanel.AddView(DraftsListView.AsView,0,0,100%x,100%y)
DraftsListView.Clear
For Each key As String In DraftsList.Keys
Dim msg As DraftMessage = DraftsList.Get(key)
DraftsListView.AddTextItem("To: " & msg.MsgTo & " - Subject: " & msg.MsgSubject, key)
Next
End Sub