Opps! VB6 term I guess. Two windows(pages?), mainform.bjl and detail.bjl and just one module, main. All of the code is in the main module and I am wondering if that is a bad practice as in the Threepages example there is a main module plus a module( .bas file) for each of the pages..
I didn't know that tutorial and those examples, so thank you, Mike
(perhaps I should also thank Erel for developing those examples
. Thanks, Erel).
1) VB6 term - in B4J Forms are... forms, as in VB6. In the Threepages example, Erel created and added to the project 2
code modules (icon:
), specifically "named" LoginForm and UserForm just to confuse you
(sooner or later I'll be able to write a post without joking... I hope
), Main is automatically added when you create a new project. Within each of these two code modules a Form is created and this is not mandatory, it is an Erel's design choice:
' CODE MODULE - named LoginForm
Sub Process_Globals
Private frm As Form ' Declaration of an object variable named "frm" of type Form - Form is a "window", as in VB6
'...
Public Sub Show
If frm.IsInitialized = False Then
frm.Initialize("frm", 400, 400)
frm.RootPane.LoadLayout("Login") ' <-- Here Erel loads A layout (containing "Views" - VB6 controls) he created, voluntary named Login,
' using the Designer, generating so a .bjl file (a "layout file").
' The Login layout is loaded in a "control" (node in b4j) of type AnchorPane named RootPane,
' which is always present by defaul in every Form you create, it is the fundamental basis.
' ...
If you want to create a master/detail form (named frmMain?), you can use just one
code module, the Main, if you want, creating the form "inside" it (see above) and a single layout (using the Designer) for both the Master and the Details GUI parts you will load into the frmMain.RootPane.
[Who knows how many nonsense I wrote: it's 3 am and I'm almost asleep
]