<!-- 
/*
Copyright 2017 apHarmony

This file is part of jsHarmony.

jsHarmony is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

jsHarmony is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this package.  If not, see <http://www.gnu.org/licenses/>.
*/
-->
<script type="text/x-tutorial-info">
{
  "Title": "Layout: Form-m",
  "Menu": ["Models","Forms"],
  "Code": [
    "/models/FormMBasic_Standard.json"
  ],
  "Demo": [
    { "url": "jsHarmonyTutorials/FormMBasic_Standard?action=update&cust_id=1", "title": "Basic Form-m" }
  ]
}
</script>

<h3>Overview</h3>
The "form-m" layout provides an interface to update multiple records in one save operation.  This layout is primarily used as a subform to edit a parent/child relationship.<br/>
<br/>
Navigation buttons are displayed for paging between records.  No data is saved until the "Save" button is pressed.
<%-getScreenshot('jsHarmonyTutorials/FormMBasic_Standard?action=update&cust_id=1&popup=1','Basic Form-m')%>
<pre>
{
  "table":"cust_addr",
  "layout":"form-m",
  "onecolumn":true,
  "caption":["Address","Addresses"],
  "fields":[
    {"name":"cust_id","control":"hidden"},
    {"name":"cust_addr_country","caption":"Country"},
    {"name":"cust_addr_line1","caption":"Address"},
    {"name":"cust_addr_line2","caption":""},
    {"name":"cust_addr_city","caption":"City"},
    {"name":"cust_addr_state","caption":"State"},
    {"name":"cust_addr_zip","caption":"Zip"}
  ]
}
</pre>

<h3>Canonical Syntax</h3>
The form-m should have at least a primary key.  In most instances, it should also have a foreign key for use in parent/child bindings:
<pre>
{
  "table":"cust_addr",
  "layout":"form-m",
  "onecolumn":true,
  "caption":["Address","Addresses"],
  "fields":[
    {"name":"cust_addr_id","key": 1,"control":"hidden"},
    {"name":"cust_id","actions":"I","foreignkey": 1,"control":"hidden"},
    {"name":"cust_addr_country","caption":"Country"},
    {"name":"cust_addr_line1","caption":"Address"},
    {"name":"cust_addr_line2","caption":""},
    {"name":"cust_addr_city","caption":"City"},
    {"name":"cust_addr_state","caption":"State"},
    {"name":"cust_addr_zip","caption":"Zip"}
  ]
}
</pre>