function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Frank van Meegen 42Frank van Meegen 42 

Refresh lightning component after button click

In a lightning component I have a button that updates a field show__c on a child record. After the update the button should be invisible. This is only working after I do a page refresh.

How can I refresh the lightning component after the button click?
<aura:component controller="SampleController" Implements="flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" >
    <aura:attribute name="childitems" type="List" />
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <!-- Use a data table from the Lightning Design System: -->
<table class="slds-table slds-table_bordered slds-table_cell-buffer slds-no-row-hover">
            <tr class="slds-text-heading_label">
                <th scope="col"><div class="slds-truncate" title="Button">Button</div></th>
            <aura:iteration items="{!v.childitems}" var="childitem">
                    <div class="slds-form-element">
                        <aura:renderIf isTrue="{!childitem.show__c}">
                        <lightning:button variant="brand" label="Sell" title="{!childitem.Id}" name="{!childitem.Id}" onclick="{!c.updateCheck11}" />

Miles Smith 5Miles Smith 5
for me, this thread solution worked
with regards ( (