2

Component:

<aura:component implements="force:appHostable,force:lightningQuickAction,flexipage:availableForRecordHome,flexipage:availableForAllPageTypes,force:hasRecordId" access="global">
    <aura:attribute name="recordId" type="string"/>    
    <aura:attribute name="isdisplay" type="boolean" default="false"/>
    <aura:attribute name="isFilter" type="boolean" default="false"/>
    <aura:attribute name="theId" type="String"/>

    <lightning:button label="Action Crietria" onclick="{!c.ActionCrietria}" />
    <lightning:button label="Filter Crietria" onclick="{!c.FilterCrietria}" />

    <aura:if isTrue="{!v.isdisplay}">
        <c:ActionPage theId="{!v.recordId}"/>
    </aura:if>

    <aura:if isTrue="{!v.isFilter}">
        <c:FilterPage theId="{!v.recordId}"/>
    </aura:if>

</aura:component>

controller:

({
      ActionCrietria : function(component, event, helper) {
          helper.fetchActionDetail(component);
      },
      FilterCrietria:function(component, event, helper) {
         helper.fetchFilterDetail(component);
     }
})

helper:

({
    fetchActionDetail : function(component,event,helper) {
       component.set("v.isdisplay",true);
    },
    fetchFilterDetail:function(component,event,helper){
       component.set("v.isFilter",true);
    }
})

Requirement: I want to display action criteria and filter criteria button in pages. If I click action criteria corresponding component has to open in this case [action page] & If I click filter criteria corresponding component has to open [filter Page]

2
  • 1
    What is not working here? Commented Apr 11, 2017 at 4:59
  • if I click action criteria--> action page [tat time I want to disable filter criteria button]...if click filtercriteria-->filterpage [tat time I want to disable action criteria button]...Function disability isntt working...
    – Annappa PH
    Commented Apr 11, 2017 at 5:02

1 Answer 1

1

Everything is fine in the code you just forgot to toggle the other variable state:

({
    fetchActionDetail : function(component,event,helper) {
        component.set("v.isFilter", false);
        component.set("v.isdisplay", true);
    },
    fetchFilterDetail:function(component,event,helper){
        component.set("v.isdisplay", false);
        component.set("v.isFilter", true);
    }
})

You must log in to answer this question.

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