Form-Generator

Layout Considerations


Init
Show the loading indicator until we have the all of the form ready
? How do we know what to pass in
Test that we can work without the formData based on the field.value
or have to
? How can we get all of the records for the multiRec View/Edit Form?

Grid

both fields and sections use the same type of grid layout
where we loop through the rows (by the row-num)
and then the cols in that row

Multi-Rec View & Add/Edit Forms

? No-Sections option so we aren’t creating a different card for each form ?
Or have Card within a Card
“AddRecordForm()”
to create another instance of the form with empty formData

Layers of Components

Form-Generator
Agnostic
Used by MyViewForms and Data-Explorer
Just accepts the List of sections and fields (via Table)
so each


Section-Management

sections new fields
row
col
is_cols flag that will check if there is more than one unique number in the col field
ideally we update the col so that it is always sequential
get the “section_blocks” as sep API call with the section_type_id param
has the List:sections inside of it based on the sections.parent_section_id
which has the List:fields
loop through these first
API call for view_fields with their section_id that we use to match up
after the new fields created for layout
Add section_type_id as param to SectionOrderEdit
“Add Form Block” option in the ContextMenu for Sections
? Can we have all of these “generic” options collected somewhere so users can hit the “Search” button for “Actions” to find them since the contextmenu could be hard to find ?
Add “Row” and “Col” dropdowns to the SectionOrderEdit
(when
Maybe under “Show Advanced Options” toggle
which is auto-enabled when views.is_grid_enabled
flag to make it easier to know if the multiple cols or rows

Field-Layout

is_horizontal_stack (is_x_stack?) → is_title_stack
set on the
forms
sections
(we may not enable editing this yet to KISS)
is_title_stack
for fields & view_fields
redundant if the is_horizontal_stack is already 1
“horizontal” vs vertical
default to “vertical”

Sections and Fields Layout Process

Loop through the sections by the
“Row” and then the “Ord (Col)” in that row
if row exists
use “view_fields.col_size” to determine if larger/smaller than the rest
(forego the form-Blocks for now?)


view_fields.col_size
int to control how many columns it takes up for greater col
sections.for_view_id (or sections.view_id/sections.section_view_id)
when the section uses a sub-form

Form-Blocks & Section-Columns
Get the Sections where section_type_id =1
Loop through these to build the grid
Edit-Section has to have an extra dropdown for the “Form-Blocks”
if they are enabled ? Or always so that can enable by moving down the “Block 2”
? How do we
Form-Blocks have the same contextmenu option as the Sections
to edit-props
to move
Get Sections list separately
even for ones that don’t have have fields
but must have the
sections.view_type_id
to be able to display DG or Templates in sections
OOS - Refactor DE into a Component and start the Form-Generator
Refactor the DataExplorer so that we can pass in the data from the view_fields instead
Consider how to setup for the Edit-Field Value Popup
to generate the control from the same RenderField() type of call but with the single field object (with the value set on the field.value)
use RecSaver or p_field_value_edit


Contextmenu options only when user is full admin
for changing the order and sections
Multi-Rec Add/Edit Form for Documents
Radzen Multi-Part Forms Sample using tabs and/or progressbar
Setup/Gen UI example (in samples dir)
pass around the record_ids between forms using table_keys
like “?contacts=11&cases=12” (table.keys)
? Possibly create a “Master-View-Tables” which has all of them in their hierarchical format?
Within forms we use an object(Dictionary) to hold the various IDs that we have selected/retrieved from the each form, so we can go multiple levels down
“Form-Customizer-View”
Shows the Field-Types and ref_table (if is_ref) instead of the data
Note: DE - could be used as a “schema-explorer” where we show the field-types instead of the values
Sections for Forms - Ensure Setup/Doc for the various types
Multi-Part Forms
Form-Blocks
mainly for UI layout - like “rows” in the dashboard
allows us to use “cols”
1-3 Cols option (but could be overridden and have up to 12 actually)
Form-Sections
can contain fields or are sub-forms
sub-forms are usually for data-grids
can override whether shown as datagrid vs form in the sections.is_datagrid
pass in all of the rec_ids

Form-Sections



Editable vs Non-Editable Fields

Option to show Non-Editable fields on the IsEditForm
like we do for the DE
otherwise we have to remove the empty sections
maybe we make a copy of the “fields” list that is just for the fields shown on the form

is_editable vs is_editable_only_once
Both can/must be true (for is_editable_only_once to work), and if so, then it just makes it disabled once there is a value assigned
is_editable vs is_editable_only_admin
One or the other has to be true
Will make it so that only admins can edit it through the popup forms
Hidden on Add/Edit Forms

“touched”

won’t work for the Multi-Record Add/Edit Forms
unless we create new Table object for each rec

Questions

Could we have the various Forms pre-generated so we are just calling them as components in order to save on the rendering of each control part manually?
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.