You need to sign in to do that
Don't have an account?
Vidula
Lightning Component Error
Hello All,
We have implemented functionality to accept user input. In this we have single select questions for which we are using radio input.
Following is the code :
Here, question.answer = selected answer ( Saved in object )
{!opt} = label of input radio
When we are trying to load lightning component for existing result, it is throwing following error.
Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. Invalid component tried calling function [get] with arguments [v.items.0]
We have also tried to use <ui:inputRadio label="Yes"/> , but design is not working for this properly, also it won't render on iPhone properly.
If anyone has faced similar issue or has any idea , please let me know.
Thanks ,
We have implemented functionality to accept user input. In this we have single select questions for which we are using radio input.
Following is the code :
<aura:renderIf isTrue='{!question.answer == opt}'> <input type="radio" value="{!question.id}" name="{!questionNumber}" onchange="{!c.onRadioSelect}" title="{!opt}" checked='checked'/>{!opt} <aura:set attribute='else'> <input type="radio" value="{!question.id}" name="{!questionNumber}" onchange="{!c.onRadioSelect}" title="{!opt}"/>{!opt} </aura:set> </aura:renderIf>
Here, question.answer = selected answer ( Saved in object )
{!opt} = label of input radio
When we are trying to load lightning component for existing result, it is throwing following error.
Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. Invalid component tried calling function [get] with arguments [v.items.0]
We have also tried to use <ui:inputRadio label="Yes"/> , but design is not working for this properly, also it won't render on iPhone properly.
If anyone has faced similar issue or has any idea , please let me know.
Thanks ,
@James Loghry : When we removed checked='checked' attribute of input, it won't give any error. But I want to show selected value so need to use this attribute.
@Fabien Tailon :
Unfortunately I can share below small piece of code only.
onRadioSelect: function(component, event, helper) {
var radioValue = $(event.target).attr("title");
var questionId = $(event.target).attr("value");
//-- saving this value in an array
}