You need to sign in to do that
Don't have an account?
Bharath Kumar Thota
Refresh a particular div in lightning component
Hi,
I have a Lightning component form which consists of many fields and parts. What I need is to refresh a particular part of the Lightning component without refreshing the whole component.
In the above image I have the Fetch Contact Info in one whole div so when I click the refresh icon it should empty all the fields if the values are present. Is there any possibility to do that, any information will be helpful.
Thanks,
Bharath Kumar Thota
I have a Lightning component form which consists of many fields and parts. What I need is to refresh a particular part of the Lightning component without refreshing the whole component.
In the above image I have the Fetch Contact Info in one whole div so when I click the refresh icon it should empty all the fields if the values are present. Is there any possibility to do that, any information will be helpful.
Thanks,
Bharath Kumar Thota
If the fields are related to a single object then you can simply initialize the object again like this:
Object con = new Object();
IN this way all the fieds will be set to null.
Thanks,
Abhishek Bansal.
All Answers
Onclick of this image you can call a contoller method and in this method you can set the values to null. In this way it will be refreshed.
Let me know if you need any more information on this.
Thanks,
Abhishek Bansal.
Thanks for the reply. Yeah I too got that thought but if we have more fields for example 20 fields we have to make 20 fields as null right. Instead of that don't we have any other way like taking the div part and making the fields in that div to empty so that we do not need to make all the 20 fields as null. Please can you suggest me if you have any idea for doing in this way.
Thank you,
Bharath Kumar Thota
If the fields are related to a single object then you can simply initialize the object again like this:
Object con = new Object();
IN this way all the fieds will be set to null.
Thanks,
Abhishek Bansal.