Multiple forms and views on one KAS page
Use the existing form_view.php / table_view.php renderers sequentially in the section PHP file. MODIFY_STOCK.php is an existing Core example: it closes its form before configuring and including the following Table View. There is no separate composition registry.
For a native lookup form followed by a Table View:
$tableOptions = $options;
$options['manual_form'] = true;
$options['live'] = false;
$options['add'] = $options['update'] = false;
$case_title = 'FIND ITEM';
$m_onsubmit = 'return false;';
$form = 'open';
include('core/form_view.php');
addField([
'type'=>'search', 'label'=>'FIND ITEM', 'name'=>'ITEM_ID', 'id'=>'findItem',
'data'=>[
'table'=>'ITEMS', 'colID'=>'ITEM_ID', 'searchCols'=>'NAME',
'result'=>'NAME', 'format'=>'NAME', 'callback'=>'openSelectedItem();'
]
]);
$form = 'close';
include('core/form_view.php');
$options = $tableOptions;
unset($tableOptions, $m_onsubmit);
$dbtable = 'ITEMS';
$idfield = 'ITEM_ID';
$case_title = 'VIEW ITEMS';
$td_titles = ['NAME'];
$td_fields = [['type'=>'text', 'col'=>'NAME']];
$s_fields = 'NAME';
$limit = 50;
$query = "SELECT ITEM_ID, NAME FROM ITEMS %%WHERE%% ORDER BY NAME";
include('core/table_view.php');
The tables/fields and registered V/R/N parent are placeholders. Define the callback separately; read the native #hiddenfindItem value and construct the target with getPath(), rather than hardcoded menu IDs. A manual lookup form performs no INSERT/UPDATE and suppresses ordinary Enter submission. Native addField(type=search) supplies dynamic results; do not recreate its endpoint or bind custom search logic.
For ordinary submitted forms, configure the real $dbtable, $idfield, $nexturl, message and add/update flags before opening; include native fields/save button and close the form before another renderer. Never nest forms. Restore or explicitly reset options for each block, including form/view/live/manual/add/update/multiselect/delete flags. Reset page variables such as title/action buttons/query/headers/fields/filters/highlights when they differ; shared include scope does not automatically isolate them.
Native form/table counters generate renderer IDs. Give each search/field a unique lowercase id key; its hidden selection uses hidden plus that ID. Avoid duplicate IDs or cross-view JavaScript selectors. Configure asset flags required by each control, and verify every block's save/navigation/search behavior in an authenticated browser. A second renderer is not a new menu section and does not itself require initialization; registration changes do.