Much time is spent creating (input) forms in ABM. It is a repetitive process.
First one must create the raw sheet: BuildCompanyInputSheet() As ABMModalSheet
Note: "companyinp" is now our unique public reference (within page), whereas userinp is the local.
Here we first setup how many rows we need and the cell layout for each.
Many rows can be added (with different cell layouts), but until they are used, they have no affect.
Next we add components to the row grid - for each cell.
Here you specify the component for each row and cell.
NOW we introduce a GUI form to help us create the ADD, UPDATE/MODIFY, DELETE.
Within, one defines which type of input, what the unique name is and what the title is along with a theme.
Assuming the Primary Key is always at position 0 (of the Select), AND we need a select statement for the items we wish to ADD or EDIT - we need to connect to the DB and table in question - to expose the fields we can include.
We also need a footer. Usually, it is Save or Cancel...
I am thinking much of this can be created dynamically with an input form designer (or not).
Any thoughts?
Thanks
First one must create the raw sheet: BuildCompanyInputSheet() As ABMModalSheet
B4X:
Dim userinp As ABMModalSheet
userinp.Initialize(page, "companyinp", False, False)
userinp.IsDismissible = False
Note: "companyinp" is now our unique public reference (within page), whereas userinp is the local.
Here we first setup how many rows we need and the cell layout for each.
B4X:
userinp.Content.AddRowsM(1, True,0,0, "").AddCells12(1,"")
' Used as a title bar (" Provide info for this company")
userinp.Content.AddRowsM(4, True,0,0, "").AddCellsOS(1,0,0,0, 6,6,6,"").AddCellsOS(1,0,0,0,6,6,6,"")
' add 4 (x) rows with 2 cells - used for data fields
userinp.Content.AddRowsM(1, True,0,0, "").AddCells12(1,"")
' add extra rows for anything you want now - or in the future.
userinp.Content.BuildGrid ' IMPORTANT
Many rows can be added (with different cell layouts), but until they are used, they have no affect.
Next we add components to the row grid - for each cell.
B4X:
Dim inpName As ABMInput
inpName.Initialize(page, "compemail", ABM.INPUT_TEXT, "User Email", False, "lightblue")
userinp.Content.Cell(2,1).AddComponent(inpName)
Dim inpowner As ABMInput
inpowner.Initialize(page, "compowner", ABM.INPUT_TEXT, "Owner Name", False, "lightblue")
userinp.Content.Cell(2,2).AddComponent(inpowner)
Here you specify the component for each row and cell.
NOW we introduce a GUI form to help us create the ADD, UPDATE/MODIFY, DELETE.
Within, one defines which type of input, what the unique name is and what the title is along with a theme.
Assuming the Primary Key is always at position 0 (of the Select), AND we need a select statement for the items we wish to ADD or EDIT - we need to connect to the DB and table in question - to expose the fields we can include.
We also need a footer. Usually, it is Save or Cancel...
I am thinking much of this can be created dynamically with an input form designer (or not).
Any thoughts?
Thanks