0

Hello I made a following component which displays all permission set which i want but now I am stuck. Here I want to display my selected permission set on the table. Although the table is displayed on my selection, but on my second selection it is stuck showing the previous selection (only bothing happens??). Can someone help here I am stuck.

My component code is:

<lightning:select label="Permission Sets" aura:id="Myzelect" onchange="{!c.noggle}" >
                 <option>--Select Value--</option> 
                 <aura:iteration items="{!v.set}" var ="d">  
                     <option>{!d.Name}</option> 
                    </aura:iteration>
                     </lightning:select>
           <!--lightning:input type="PermissionSet[]" label="Profile"   onclick="{!c.doInit}" value="{!d.Name}"/--> 

     </div>
        </div>
    </div>  

       <aura:if isTrue="{!v.noggleGer}">
       <table class="slds-box slds-table--bordered slds-table--cell-buffer ">
<thead>
<tr>
    <th scope="col">
           <span class="slds-align_absolute-center slds-theme_shade slds-theme_alert-texture" style="height:2rem" title="User Name">USER NAME</span>
       </th>

   <th scope="col">
      <span class="slds-align_absolute-center slds-theme_shade slds-theme_alert-texture" style="height:2rem" title="User Profile">Identifier</span>
   </th>

  <th scope="col">
    <div class="slds-align_absolute-center slds-theme_shade slds-theme_alert-texture" style="height:2rem" title="Permission Set Name">IsCustom</div>
  </th>

    <th scope="col">
    <div class="slds-align_absolute-center slds-theme_shade slds-theme_alert-texture" style="height:2rem" title="Permission Set Name">LastLoginDate</div>
  </th>


</tr>
</thead>
    <tbody>
            <aura:iteration items="{!v.zet}" var="perm"> 
                                   <tr class="slds-text-color_weak slds-text-font_monospace">

  <th scope="row">
    <div class="slds-align_absolute-center" style="height:2rem" title="{!perm.Assignee.Name}">{!perm.Assignee.Name}</div>
  </th>

  <th scope="row">
    <div class="slds-align_absolute-center" style="height:2rem" title="{!!perm.Assignee.FederationIdentifier}">{!perm.Assignee.FederationIdentifier}</div>
  </th>

   <th scope="row">
    <div class="slds-align_absolute-center" style="height:2rem" title="{!perm.PermissionSet.Label}">{!!perm.PermissionSet.IsCustom}</div>
  </th> 

    <th scope="row">
   <div class="slds-align_absolute-center" style="height:2rem" title="{!perm.Assignee.LastLoginDate}">{!perm.Assignee.LastLoginDate}</div>
  </th> 


</tr>

            </aura:iteration>   

        </tbody>
    </table>  
      </aura:if>



           <aura:set attribute="else">
               <table class="slds-box slds-table--bordered slds-table--cell-buffer ">
<thead>
<tr>
    <th scope="col">
           <span class="slds-align_absolute-center slds-theme_shade slds-theme_alert-texture" style="height:2rem" title="User Name">USER NAME</span>
       </th>

   <th scope="col">
      <span class="slds-align_absolute-center slds-theme_shade slds-theme_alert-texture" style="height:2rem" title="User Profile">Identifier</span>
   </th>

  <th scope="col">
    <div class="slds-align_absolute-center slds-theme_shade slds-theme_alert-texture" style="height:2rem" title="Permission Set Name">IsCustom</div>
  </th>

    <th scope="col">
    <div class="slds-align_absolute-center slds-theme_shade slds-theme_alert-texture" style="height:2rem" title="Permission Set Name">LastLoginDate</div>
  </th>


</tr>
</thead>
    <tbody>
            <aura:iteration items="{!v.zet}" var="perm"> 
                                   <tr class="slds-text-color_weak slds-text-font_monospace">

  <th scope="row">
    <div class="slds-align_absolute-center" style="height:2rem" title="{!perm.Assignee.Name}">{!perm.Assignee.Name}</div>
  </th>

  <th scope="row">
    <div class="slds-align_absolute-center" style="height:2rem" title="{!!perm.Assignee.FederationIdentifier}">{!perm.Assignee.FederationIdentifier}</div>
  </th>

   <th scope="row">
    <div class="slds-align_absolute-center" style="height:2rem" title="{!perm.PermissionSet.Label}">{!!perm.PermissionSet.IsCustom}</div>
  </th> 

    <th scope="row">
   <div class="slds-align_absolute-center" style="height:2rem" title="{!perm.Assignee.LastLoginDate}">{!perm.Assignee.LastLoginDate}</div>
  </th> 


</tr>

        </aura:iteration>

        </tbody>
    </table>  
      </aura:set>

My Controller code is:

    noggle: function (component, event, helper) {
             var sel = component.find("Myzelect");
             var nav =  sel.get("v.value");
             if (nav == "Create_Modify_Exchange_Rates") {     
                  component.set("v.noggleGer", true);
             }
              else if (nav == "BV_Aramis_Interface") {     
                  component.set("v.moggleGer", true);
             }
         },



      doInit: function(component, event, helper) {
      //call apex class method
      var action = component.get('c.PermissionSetLst');
      action.setCallback(this, function(response) {
       //store state of response
       var state = response.getState();
       if (state === "SUCCESS") {



    //set response value in ListOfAccount attribute on component.
    component.set('v.set', response.getReturnValue());

   }

  });
   $A.enqueueAction(action);  

      var action = component.get('c.PermissionSetRep');
  action.setCallback(this, function(response) {
   //store state of response
   var state = response.getState();
   if (state === "SUCCESS") {

    //set response value in ListOfAccount attribute on component.
    component.set('v.met', response.getReturnValue());

   }




});
   $A.enqueueAction(action);




       var action = component.get('c.PermissioExchange');
  action.setCallback(this, function(response) {
   //store state of response
   var state = response.getState();
   if (state === "SUCCESS") {

    //set response value in ListOfAccount attribute on component.
    component.set('v.zet', response.getReturnValue());

   }

  });
   $A.enqueueAction(action);  
 }

})
  • Your code is not clear. Can you paste the code again and check that everything is clear for anybody to be able to help you? – salesforce-sas Aug 20 '19 at 10:47
  • I did a quick edit to try to ensure the code is shown correctly. (I didn't fix indentation over and above those lines that were not indented enough) – Phil W Aug 20 '19 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.