function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vinny rvinny r 

Lightning Component Framework Specialist - issue in validating step 9

I am getting below error. Can someone please help

Challenge Not yet complete... here's what's wrong:
The FiveStarRating controller placeholders aren't filled in correctly.


Please see my code below.

FiveStarRating.cmp
 
<aura:component >
    <aura:attribute name="value" type="integer" default="0"/>
    <aura:attribute name="readOnly" type="boolean" default="false"/>
    <ltng:require styles="{!$Resource.fivestar + '/rating.css'}" scripts="{!$Resource.fivestar + '/rating.js'}" afterScriptsLoaded="{!c.afterScriptsLoaded}"/> 
 	<aura:handler name="change" value="{!v.value}" action="{!c.onValueChange}"/>
    
    <ul aura:id="ratingarea" class="{!v.readOnly?'c-rating readonly':'c-rating'}">
    </ul>	
</aura:component>
FiveStarRatingController.js
 
({
	onValueChange:function(component,event,helper)
    {
      	console.log('In onValueChange function')
          if(component.ratingObj)
        {
            var value=component.get('v.value');
            component.ratingObj.setRating(value,false);
        }
    },
    afterScriptsLoaded:function(component,event,helper)
    {
        var domE1 = component.find("ratingarea").getElement();
        var readOnly = component.get('v.readOnly');
        var currentRating = component.get('v.value');
        var maxRating = 5;
        var callback = function(rating)
        				{
                            component.set('v.value',rating);
                        }
        
        component.ratingObj=rating(domE1,currentRating,maxRating,callback,readOnly);
    }
})


 
SandhyaSandhya (Salesforce Developers) 
Hi,

Check below link which has the resolution for the same error with below line.
 
var domEl = component.find("ratingarea").getElement();

https://developer.salesforce.com/forums/?id=9060G000000MUtyQAG

Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
                                             
Best Regards
Sandhya
 
 
 
Nitish Pisal 12Nitish Pisal 12
@Vinny : were you able to resolve this issue ? I am facing same problem.

@Sandya: link is not working. please paste the solution