0

Iam facing following error with my code:

This page has an error. You might just need to refresh it. Assertion Failed!: Provider type not supported : false Failing descriptor: {c:Picklistversion2}

can anyone take a look into this :

<aura:component controller="Picklistverion2" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" >

 <aura:attribute name="set" type="object"/>

 <div class="slds-text-body_regular">
  <aura:iteration items="{!v.set}" var ="d">        
 <lightning:input  label="Profile"  value="{!d.Name}" onchange="{!c. doInit}"/> 
              </aura:iteration>       
         </div>
</aura:component>

Controller function for this :

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);
 }

my Class for this

public class Picklistverion2 {
     @AuraEnabled
    public static List<PermissionSet> PermissionSetLst()
    {
         return [SELECT Name FROM PermissionSet WHERE IsCustom = TRUE AND IsOwnedByProfile = FALSE];
    }        

}

I want my query output inside my lightning input so that after i''ll move ahead for further conditions

3
  • You have some sporadic spaces in your markup that probably should not be there (e.g. {!c. doInit}. Please try fixing your spaces so that they look more like any of the code examples in the documentation.
    – sfdcfox
    Aug 15, 2019 at 13:55
  • Thanks @sfdcfox you are the saviour for me to fix this error but it fixed the error but nothing happens. i want my class output but nothing happens. Aug 15, 2019 at 14:06
  • @sfdcfox, in aura expressions, spaces are not a problem. Even {! c.doInit } is not a problem Aug 15, 2019 at 15:15

1 Answer 1

1

You are missing the init handler because of which the method is not invoking on init:

<aura:attribute name="set" type="object"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />

<div class="slds-text-body_regular">
    <aura:iteration items="{!v.set}" var ="d">        
        <lightning:input  label="Profile"  value="{!d.Name}" onchange="{!c. doInit}"/> 
    </aura:iteration>       
</div>
2
  • Thanks @salesforce-sas You are a genius it fixed my iteration part now values are getting displayed what i want but still one problem i want a drop down for my value and this input gives me separte input boxes for each output which is coming from query result. it would be possible if i get a picklist type option inspite of so many separtae boxes so that i can select each output query result and do further part. Aug 15, 2019 at 15:31
  • 1
    i got the solution on iterating it like a option we can achieve this . Any way thanks all for kind help. Aug 15, 2019 at 15:47

You must log in to answer this question.

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