0

I have LWC component tab "DealSearch" to search the records based on "searchstring". After getting search result on DealSearch tab, I am switching from the LWC tab to another tab eg:- Account, then again coming back to DealSearch. Instead of refreshing the page, I am seeing the old data on my LWC tab.

6
  • Are you using your LWC tab on the record page? can you share some code?
    – Klecool
    Sep 4, 2020 at 6:29
  • <?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="soap.sforce.com/2006/04/metadata"> <apiVersion>48.0</apiVersion> <isExposed>true</isExposed> <targets> <target> lightning__Tab </target> </targets> </LightningComponentBundle> Sep 4, 2020 at 6:38
  • Only exposed to tab and using it in my custom tab Sep 4, 2020 at 6:38
  • directly added my LWC component bundle to Lightning tab and created "DealSearch" custom tab. Sep 4, 2020 at 6:41
  • It seems we should not directly create tab with LWC component bundle, otherwise this refresh issue will persist, thanks. Sep 4, 2020 at 11:46

2 Answers 2

0

You need to create Aura Component and put your LWC component inside that aura component. For custom tab, use the aura component.(code reference)

<aura:component implements="force:appHostable"> <c:LwcComponent/> </aura:component>

0

after search result you can use this code to refresh.

eval("$A.get('e.force:refreshView').fire();");

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .