Form
OFormComponent
Directive: o-form
Component hierarchy
- o-form
- o-form-toolbar
Inputs
Name | Since | Description | Default |
---|---|---|---|
after-insert-mode new | detail | close |
| Shows reseted form after insert a new record (new) or shows the inserted record after (detail). This property works in substitution of stay-in-record-after-insert (detail) | close |
attr string |
| Field identifier. Registry property if component is inside a form. |
|
columns string |
| Entity columns. Separated by ‘;’ |
|
confirm-exit no | false | yes | true |
| Indicates whether or not the form confirm when it exit | yes |
delete-method string |
| Service method name for deletions | delete |
detect-changes-on-blur no | false | yes | true |
| Indicates whether or not the form will detect inner components changes (for updating toolbar buttons) on its blur | yes |
detect-changes-on-blur no | false | yes | true |
| Indicates whether or not the form detects that there was a change in the blur event of the form components. | yes |
editable-detail no | false | yes | true |
| Indicates whether or not the form default detail mode is editable. This is extensively explained in the form lifecycle) section | yes |
entity string |
| Service entity name |
|
header-actions string |
| Available action buttons in form toolbar of standard CRUD operations, separated by ‘;’. Available options are R;I;U;D (Refresh, Insert, Update, Delete). Also ‘all’ is available (showing all buttons). |
|
header-mode none | floating |
| Form toolbar display mode | floating |
ignore-default-navigation yes | no | true | false |
| ignore default navigation when user click the toolbar buttons. | no |
ignore-on-exit string |
| Fields attr’s that will be ignored when the form is closed, separated by ‘;’. |
|
include-breadcrumb no | false | yes | true |
| Indicates whether or not the form toolbar will render its parent ‘form-container’ breadrcrumb (only working if the form is inside a ‘form-container’ with a breadcrumb) | yes |
insert-method string |
| Service method name for insertions | insert |
keys string |
| Entity keys. Separated by ‘;’ |
|
keys-sql-types string |
| Entity keys SQL types, separated by ‘;’ |
|
label-header string |
| Displayable text in the form toolbar |
|
label-header-align start | center | end |
| Alignment of the form toolbar text | center |
layout-align string |
| Component alignment inside the form |
|
layout-direction column | row |
| Direction of the form main content | column |
layout-fill no | false | yes | true |
| Indicates whether or not the form content will be expanded and occupying all its parent layout | yes |
message-service-type string |
| Custom service to display CRUD and other actions form messages |
|
parent-keys string |
| Filtering keys. Separated by ‘;’ |
|
query-fallback-function string |
| Function to execute on query error |
|
query-method string |
| Service method name for queries | query |
query-on-init no | false | yes | true |
| Query table data on init | yes |
service string |
| JEE service path |
|
service-type string |
| Injection token indicated in the provider of the service |
|
set-value-order string | 15.1.0 | Fields attr’s order that will be be set values in this order in the form, separated by ‘;’ |
|
show-header no | false | yes | true |
| Indicates whether or not to show the form toolbar | yes |
show-header-actions-text no | false | yes | true |
| Indicates whether or not to show the text of the form toolbar buttons | yes |
show-header-navigation no | false | yes | true |
| Indicates whether or not to include navigations buttons in form-toolbar. It’s not included when the form is content in tab mode in the o-form-layout-manager component. Learn more about | no |
stay-in-record-after-edit no | false | yes | true |
| Indicates whether or not to stay in the edited detail form after a successful edition | no |
stay-in-record-after-insert no | false | yes | true |
| Indicates whether or not to show the detail form after inserting a new record. Will be deprecated on version 8.x.x | no |
undo-button no | false | yes | true |
| Include undo button in form toolbar (only showed if form is editable) | yes |
update-method string |
| Service method name for updates | update |
Outputs
Name | Since | Description |
---|---|---|
beforeCloseDetail | Event triggered before leaving form detail mode | |
beforeGoEditMode (deprecated) | Event triggered befoe going to form edition mode | |
beforeInitialMode | Event triggered before changing the form into initial mode | |
beforeInsertMode | Event triggered before changing the form into insert mode | |
beforeUpdateMode | Event triggered before changing the form into update mode | |
onBeforeDelete | Event triggered before data is removed | |
onBeforeInsert | Event triggered before data is inserted. | |
onBeforeUpdate | Event triggered before data is updated. | |
onCancel | Event triggered when the form has been cancel | |
onDataLoaded | Event triggered when the data is loaded | |
onDelete | Event triggered when the data is removed | |
onFormModeChange | Event triggered when form mode changes | |
onInitialMode | Event triggered once the form has changed to initial mode | |
onInsert | Event triggered when the data is inserted | |
onInsertMode | Event triggered once the form has changed to insert mode | |
onUpdate | Event triggered when the data is updated | |
onUpdateMode | Event triggered once the form has changed to update mode |
Methods
back |
---|
Navigate back |
clearFieldValue |
---|
Reset the value of the control in the form. |
Parameters |
attr: string, options: IFormValueOptions |
clearFieldValues |
---|
Reset the value of each control in the form. |
Parameters |
attrs: string[], options: IFormValueOptions |
closeDetail |
---|
Close current detail form |
delete |
---|
Performs 'delete' action |
deleteData |
---|
Allow to manage the call to the delete service |
Parameters |
filter |
getFieldReference |
---|
Retrieves the reference of the control in the form. |
Parameters |
attr: string |
getFieldReferences |
---|
Retrieves the reference of each control in the form. |
Parameters |
attrs: string[] |
getFieldValue |
---|
Return the current value of the control in the form |
Parameters |
attr: string |
Returns |
any |
getFieldValues |
---|
Return an object with the values of each attribute |
Parameters |
attrs: string[] |
Returns |
any |
getKeysValues |
---|
Get keys values |
insert |
---|
Performs insert action. |
insertData |
---|
Allow to manage the call to the insert service |
Parameters |
values, sqlTypes?: object |
isInInitialMode |
---|
Determines whether in initial mode |
isInInsertMode |
---|
Determines whether in insert mode |
isInQueryMode |
---|
Determines whether in read mode |
isInUpdateMode |
---|
Determines whether in update mode |
queryData |
---|
Allow to manage the call to the service data |
Parameters |
filter:any |
reinitialize |
---|
Allow reinitialize form adding options |
Parameters |
OFormInitializationOptions |
reload |
---|
Reload the form data |
Parameters |
useFilter:boolean=false |
setData |
---|
Sets new data for the form |
Parameters |
data:any |
setFieldValue |
---|
Sets the value of the control in the form. |
Parameters |
attr: string, value:any, options: IFormValueOptions |
setFieldValues |
---|
Sets the value of each control in the form. |
Parameters |
values:any, options: IFormValueOptions |
setFormMode |
---|
Sets form operation mode |
Parameters |
mode: number |
setInitialMode |
---|
Set initial mode |
setInsertMode |
---|
Set insert mode |
setQueryMode |
---|
Set read mode |
setUpdateMode |
---|
Set update mode |
undo |
---|
Undo last change |
update |
---|
Performs 'update' action |
updateData |
---|
Allow to manage the call to the update service |
Parameters |
filter, values, sqlTypes?: object |
OFormToolbar
Directive: o-form-toolbar
Inputs
Name | Since |
---|---|
form-data |
|
header-actions string |
|
label-header string |
|
IFormValueOptions
Directive: IFormValueOptions
Inputs
Name | Since | Description |
---|---|---|
changeType 0 | 1 |
| If changeType is 0, the onValueChage event will trigger an event performed by the user but an event performed by programming. |
emitEvent boolean |
| If emitEvent is true, this change will cause a valueChanges event on the FormControl to be emitted. This defaults to true (as it falls through to updateValueAndValidity). |
emitModelToViewChange string |
| If emitModelToViewChange is true, the view will be notified about the new value via an onChange event. This is the default behavior if emitModelToViewChange is not specified. |
emitViewToModelChange string |
| If emitViewToModelChange is true, an ngModelChange event will be fired to update the model. This is the default behavior if emitViewToModelChange is not specified. |
onlySelf boolean |
| If onlySelf is true, this change will only affect the validation of this FormControl and not its parent component. This defaults to false. |
OFormGlobalConfig
Inputs
Name | Since | Description | Default |
---|---|---|---|
headerActions | 8.14.15 | Available action buttons in form toolbar of standard CRUD operations, separated by ‘;’. Available options are R;I;U;D (Refresh, Insert, Update, Delete). Also ‘all’ is available (showing all buttons). |
|