Skip to content

BoltInput

Utility component to be used instead of a the combination of <lightning-input> and useReactiveBinding in case of using useForm or createForm

<template>
<c-bolt-input lwc:spread={$Case.Subject}></c-bolt-input>
<c-bolt-input lwc:spread={$Case.Status}></c-bolt-input>
</template>

Defaulted to edit

Defaulted to combobox. Dictates how will be rendered fields of type picklist.

type : 'text' | 'number' | 'toggle' | 'checkbox' | 'checkbox-button' | 'url' | 'email' | 'picklist' | 'tel' | 'date' | 'datetime'

Section titled “type : 'text' | 'number' | 'toggle' | 'checkbox' | 'checkbox-button' | 'url' | 'email' | 'picklist' | 'tel' | 'date' | 'datetime'”

Attribute : [field=<ObjectApiName>.<FieldApiName>]

Section titled “Attribute : [field=<ObjectApiName>.<FieldApiName>]”

Class name : .<ObjectApiName>.<FieldApiName>

Section titled “Class name : .<ObjectApiName>.<FieldApiName>”
import { mix, useForm, useDML, BoltElement } from 'c/boltage';
import fields from './caseFields.js';
export default class myLwc extends mix(
BoltElement
useForm({fields}),
useDML
) {
async handleSave() {
if(this.refs.form.validity)
await this.saveRecord(this.Case);
}
}
<template>
<c-bolt-input lwc:spread={$Case.Subject}></c-bolt-input>
<c-bolt-input lwc:spread={$Case.Status}></c-bolt-input>
<c-bolt-input lwc:spread={$Case.Priority}></c-bolt-input>
<c-bolt-input lwc:spread={$Case.Contact}></c-bolt-input>
<lightning-button label="Save the record" onclick={handleSave}></lightning-button>
</template>