File

projects/components/widgets/data/form/src/live-form/live-form.component.doc.ts

Description

The wmLiveForm component defines a live-form in the layout.

Index

Methods
Inputs

Methods

cancel
cancel()

This method is used to cancel the current operation.

Returns : void
clearMessage
clearMessage()

This method is used to clear the message in the form in case of inline message layout.

Returns : void
delete
delete()

This method is used to delete a record in the form.

Returns : void
edit
edit()

This method is used to edit the form. Form will go into edit mode.

Returns : void
highlightInvalidFields
highlightInvalidFields()

This method loops through the form fields and highlights the invalid fields.

Returns : void
new
new()

This method is used to open a new form.

Returns : void
onBeforeservicecall
onBeforeservicecall($event: MouseEvent, $operation: string, $data: any, options: any)

Callback is triggered on save of form and before sending service call. This callback can be used to validate or modify data.

Parameters :
Name Type Optional Description
$event MouseEvent No

DOM event on which call back is triggered

$operation string No

current operation being performed on form - update/insert/delete

$data any No

Input data collected from the form widget

options any No

extra options can be passed by user here. Ex: setting options.period = true will send temporal call

Returns : void | boolean

if the callback returns false, form submit is stopped. Anything else, form submit continues with modified data.

onError
onError($event: MouseEvent, $operation: string, $data: any)

This event handler is called whenever the form submit returns an error.

Parameters :
Name Type Optional Description
$event MouseEvent No

DOM event on which call back is triggered

$operation string No

current operation being performed on form - update/insert/delete

$data any No

response returned from the service call

Returns : void
onResult
onResult($event: MouseEvent, $operation: string, $data: any)

This event is called after service call returns response, whether or not the service call was successful.

Parameters :
Name Type Optional Description
$event MouseEvent No

DOM event on which call back is triggered

$operation string No

current operation being performed on form - update/insert/delete

$data any No

response returned from the service call

Returns : void
onSubmit
onSubmit()

This method is used to submit the form.

Returns : void
onSuccess
onSuccess($event: MouseEvent, $operation: string, $data: any)

This event handler is called whenever the form submit is success.

Parameters :
Name Type Optional Description
$event MouseEvent No

DOM event on which call back is triggered

$operation string No

current operation being performed on form - update/insert/delete

$data any No

response returned from the service call

Returns : void
reset
reset()

This method is used to reset the form.

Returns : void
saveAndNew
saveAndNew()

This method is used to save the form. / save(event?, updateMode?, newForm?) {} /** This method is used to save the form and open new form on save success.

Returns : void
saveAndView
saveAndView()

This method is used to save the form and open the view mode of form on save success.

Returns : void
toggleMessage
toggleMessage(show: boolean, msg?: string, type?: string, header?: string)

This method is used to show the message in the form.

Parameters :
Name Type Optional Description
show boolean No

Show or hide the message

msg string Yes

message content

type string Yes

type of the message - error, success, info or warning

header string Yes

title of the message

Returns : void

Inputs

autocomplete
Type : boolean
Default value : false

Enabling this property turns on auto-completion in the editor. As the user types the choices in the drop-down select editor change dynamically.

captionalign
Type : string
Default value : 'left'

Defines the alignment of the caption elements of widgets inside the form.

Allowed Values: left, center, right

left: Caption is aligned to left.

center: Caption is aligned in center.

right: Caption is aligned to right.

captionposition
Type : string
Default value : 'left'

Defines the position of the caption elements of widgets inside the form.

Allowed Values: left, top, right

left: Caption is positioned to left of form widget.

top: Caption is positioned on top of form widget.

right: Caption is positioned to right of form widget.

captionwidth
Type : string
Default value : 'xs-12 sm-3 md-3 lg-3'

Accepts integer(x) between 1-12 and adds class col-xs-(x) for mobile, col-sm-(x) for Tablet Potrait, col-md-(x) for Laptop Tablet Landscape , col-lg-(x) for Large screen to suit bootstrap fluid grid system.

class
Type : string

Class of the widget.

collapsible
Type : boolean
Default value : false

Enable control for collapsing and expanding the widget.

dataset
Type : any

This property specifies the datasource to which values of form are submitted.

Bindable: true

defaultmode
Type : string
Default value : 'View'

This property controls whether live form is in view or edit mode when form is opened

Allowed Values: Edit, View

Edit: Live Form is opened in edit mode.

View: Live Form is opened in view mode.

deletemessage
Type : string
Default value : 'Record deleted successfully'

This message will be displayed, when data is deleted by liveform.

Bindable: true

errormessage
Type : string
Default value : 'An error occured. Please try again!'

This message will be displayed, if there is an error during form submit.

Bindable: true

expanded
Type : boolean
Default value : false

Set the default state of the form whether it is expanded or collapsed.

formdata
Type : any

Default data to show in the form on load.

Bindable: true

iconclass
Type : string

CSS class of the icon showed in form header.

Bindable: true

insertmessage
Type : string
Default value : 'Record added successfully'

This message will be displayed, when data is inserted by liveform.

Bindable: true

messagelayout
Type : string
Default value : 'Toaster'

This property decides the appearance of the success/error message after submit operation.

Allowed Values: Inline, Toaster

Inline: Message is shown at the top of the form widget.

Toaster: Message is shown in the toaster.

name
Type : string

Name of the form widget.

show
Type : boolean

This property will be used to show/hide the live form widget on the web page.

Bindable: true

subheading
Type : string

This property defines the sub heading or title for the widget.

Bindable: true

tabindex
Type : number
Default value : 0

This property specifies the tab order of the Form Widget.

title
Type : string

Title of the form.

Bindable: true

updatemessage
Type : string
Default value : 'Record updated successfully'

This message will be displayed, when data is updated by liveform.

Bindable: true

validationtype
Type : string
Default value : 'default'

This property defines the type of validation applied on the form.

Allowed Values: default, html, none

default: Inline validations are applied on form submit.

html: HTML 5 validations are applied on form submit.

none: Validations are disabled on form.

results matching ""

    No results matching ""