Basically I have code like the following in my component:
Component:
<aura:if isTrue="{!v.isEditMode}">
<force:inputField value="{!v.contact.LastName}"/>
<aura:set attribute="else">
<force:outputField value="{!v.contact.LastName}"/>
</aura:set>
</aura:if>
<lightning:button variant="neutral" label="{!if(v.isEditMode, 'Save', 'Update')}" onclick="{!c.toggleMode}" />
Controller:
toggleMode : function(component, event, helper) {
var isEditMode = component.get("v.isEditMode");
component.set("v.isEditMode", !isEditMode)
}
When it first renders everything works just fine. But, when we re-render (by clicking on button) to make hidden area visible force:outputField and force:inputField disappear.
Does anybody faced this issue, any workarounds?
Best Answer
Hey I am nit sure why are you facing this problem but can you try using the below code if it works -