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: https://www.lightningdesignsystem.com/components/data-tables/ -->
    
<table class="slds-table slds-table_bordered slds-table_cell-buffer slds-no-row-hover">
        <thead>
            <tr class="slds-text-heading_label">
                <th scope="col"><div class="slds-truncate" title="Button">Button</div></th>
                
            </tr>
        </thead>
        <tbody>
            <aura:iteration items="{!v.childitems}" var="childitem">
                <tr>
   
                    <td>
                    <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}" />
                 
                            </aura:renderIf>
                        </div>
                        
                    
                    </td>
                    
                    
                </tr>
            </aura:iteration>
        </tbody>
    </table>
 
</aura:component>

 
Miles Smith 5Miles Smith 5
for me, this thread solution worked https://salesforce.stackexchange.com/questions/164931/is-there-a-way-to-call-javascript-after-action-on-visualforce-page
with regards
kodi.software/ messenger.red (https://messenger.red/) hotstar.onl (https://hotstar.onl/)