wiki:FormElement

<form>

The <form> element is used to define a user element that shows the records of a certain entity on screen (including insert, update, save, search, etc). A form may have tabbed <menu> or un-tabbed <form> or <plugin> subscreens which are defined by nesting other user interface elements.

Example usage of <form> element:

<form name="myname" entity="myentity">
  <form name="myname" entity="mysubentity" sortby="name"/>
</form>
        
<form name="myname" entity="myentity" viewtype="list" limit="10"/>

Required attributes

  • name="name": locally unique name for this screen element (within its container).
  • entity="myentity": which data entity will be loaded (i.e., points to a <entity name="myentity"/>).

Optional attributes

  • label="Nice screen name": a user-friendly alias to show as form header (default: copied from name).
  • header="Nice screen title": a user-friendly title for the screen that is displayed when this form is selected (default: copied from label).
  • viewtype="record" or viewtype="list": whether the form should start with a list or per-record (default: "record").
  • sortby="aFieldInEntity": on what field the data should be sorted on default (default: first unique field/autoid).
  • limit="10": how many records must be shown in the list (default: "5").
  • readonly="true": can the records be edited or is the form readonly (default: "false").
  • compact_view="field1,field2": only show the selected fields on the form and have a 'show additional fields' button to expand to see all fields
  • commands="package.Class1,package.Class2": optional extension point to add custom commands to the generated forms. See MolgenisCustomCommands?.
  • hide_fields="field1,field2": optional setting to hide fields from view. This requires the fields to be nillable="true" or auto="true" or default!=""

Child elements

  • Zero or more <menu> elements to denote subscreen(s).
  • Zero or more <form> elements to denote subscreen(s).
    Nested forms are automatically linked to the containing form based on foreign key (xref) relationships.
  • Zero or more <plugin> elements to denote subscreen(s).