Forms
[WINDEV]
Last Edit: January 30, 2018 the alpha360 team
All Form windows have the following definition:
IWF_MyForm(LOCAL p_OpenWindow is ST_a360_DynamicWindow,sReturnPK is string="", bChanged is boolean=False)
Independent HFSQL context:
always turned ON
UI elements:
They usually have edit controls, combos etc. linked to local window variables
The Embeds [most common]:
End of Initialization of IWB_MyForm
UI_UserAccess() // Controls user access
UI_Format() // Formats currencies and numbers
UI_Translate // Translate the Window
UI_Init() // Clears or Retrieves data etc .
The LOCAL Procedures [most common]:
UI_UserAccess() // Controls user access
UI_Format() // Formats currencies and numbers
UI_RefreshWindow() // Refreshes windows UI
UI_RefreshLookups() // Refreshes COMBO boxes etc .
UI_Init // Clears or Retrieves data etc .
UI_Cancel // Cancels the editing ...
UI_Close // Closes the form
UI_Save // Saves - completes and Add, Edit or Delete
UI_CheckRequiredFields // Checks for missing data
UI_CleanUpData // Clean up data
UI_CreateTranslation // Automatically Create Translation entries
Forms are usually used when adding (or editing or deleting or viewing) simple objects - like product records - or more complex objects - like invoices.
They are usually called from Browses but you can call them from anywhere you want.
Lets see how the IWF_Product form works:
1. Pass a p_OpenWindow structure to the IWF_Product form when we "call it"
2. In the Global declarations area of the form we create 2 variables of type gProduct
3. call UI_UserAccess
4. call UI_Format
5. call UI_Translate
6. call UI_Init
IF p_OpenWindow.nAction = 1 was passed -> this is an ADD/INSERT
IF p_OpenWindow.nAction = 2 (or 3 or 4) this is an EDIT (or DELETE or VIEW)
7. the user clicks the Save Button and UI_Save is executed
Complex forms generally work the same way as simple forms do.
They just have to handle data in temporary tables also - like products in invoices.
Take a look at the code in the IWF_Sales procedure and post any questions you may have in our support forums.
next - > Reports [WIN}
Copyright 2017/18 - computerplus