buli
2023-05-23 19f3491cd91e0c863eb13f0c6c69aca5634ed1d9
force-app/main/default/lwc/lexLookup/lexLookup.js
@@ -26,6 +26,7 @@
    @api newRecordOptions = [];
    @api minSearchTermLength = 2;
    @api isDisabledForDealerText = false;
    @api accountValue = '';
    // Template properties
    searchResultsLocalState = [];
@@ -138,6 +139,7 @@
    @api
    getSelection() {
        console.log('get selection:' +this._curSelection);
        return this._curSelection;
    }
@@ -155,6 +157,7 @@
    }
    connectedCallback(){
        console.log('LexLookup accountValue = ' + this.accountValue);
        console.log('isDisabledForDealerText = ' + this.isDisabledForDealerText);
    }
@@ -262,6 +265,7 @@
            // If the user presses enter, and the box is open, and we have used arrows,
            // treat this just like a click on the listbox item
            const selectedId = this._searchResults[this._focusedResultIndex].id;
            console.log('selectedid:'+selectedId);
            this.template.querySelector(`[data-recordid="${selectedId}"]`).click();
            event.preventDefault();
        }
@@ -333,6 +337,7 @@
    handleClearSelection() {
        this._curSelection = [];
        this._hasFocus = false;
        this.accountValue = '';
        // Process selection update
        this.processSelectionUpdate(true);
    }
@@ -445,6 +450,8 @@
    }
    get getSelectIconName() {
        if(this._curSelection[0])
            console.log('this._curSelection[0].icon = ' + this._curSelection[0].icon);
        return this.hasSelection() ? this._curSelection[0].icon : 'standard:default';
    }
@@ -456,6 +463,9 @@
        if (this.isMultiEntry) {
            return this._searchTerm;
        }
        if(this.accountValue != ''){
            return this.accountValue;
        }
        return this.hasSelection() ? this._curSelection[0].title : this._searchTerm;
    }