You need to sign in to do that
Don't have an account?
Carolina W 2
In Step 1 on an Omniscript, I have two text elements: "neighborhood" and "city".
There is also the "Search" button made in LWC. I need it to be disabled only if the fields "neighborhood" OR "city" are empty, but I'm not getting it... Can anyone help me? Here's what I tried to do initially:
Omniscript
Preview
searchButtonLWC.html
searchButtonLWC.js
How can I disable a LWC button only if the Omniscript fields are empty?
In Step 1 on an Omniscript, I have two text elements: "neighborhood" and "city".
There is also the "Search" button made in LWC. I need it to be disabled only if the fields "neighborhood" OR "city" are empty, but I'm not getting it... Can anyone help me? Here's what I tried to do initially:
Omniscript
Preview
searchButtonLWC.html
<template><div><lightning-button variant="destructive" label="Search" onclick={handleClick} disabled={disableButton} class="slds-m-vertical_medium"></lightning-button></div></template>
searchButtonLWC.js
import { LightningElement, api} from 'lwc'; import { OmniscriptActionCommonUtil } from "vlocity_cmt/omniscriptActionUtils"; import { getNamespaceDotNotation } from "vlocity_cmt/omniscriptInternalUtils"; import { OmniscriptBaseMixin } from 'vlocity_cmt/omniscriptBaseMixin'; export default class searchButtonLWC extends OmniscriptBaseMixin(LightningElement) { @api neighborhood; @api city; _ns = getNamespaceDotNotation(); _actionUtilClass; connectedCallback() { this._actionUtil = new OmniscriptActionCommonUtil(); } handleClick() { } get requiredFieldsFilled(){ return (this.neighborhood && this.city); } disableButton(){ return !(this.requiredFieldsFilled()); } }
To