You need to sign in to do that
Don't have an account?
Chandan Kumar 100
Hello Everyone My question is related to UI component code is not working properly
Conponent is
<aura:component >
<ui:inputText label="name" aura:id="name" placeholder="Enter your name"/>
<ui:outputText aura:id="nameoutput" value=""/>
<ui:button aura:id="buttonid" label="Submit" press="{!c.getInput}"/>
</aura:component>
****client side controller is ***
({
getinput : function(cmp , event) {
var.fullname = cmp.find("name").get("v.value");
var.outname = cmp.find("nameoutput");
outname.set("v.value",fullname+"***");
}
})
not working properly
error message is****
This page has an error. You might just need to refresh it. Component class instance initialization error [Cannot read property 'apply' of undefined] Failing descriptor: {markup://aura:application}
<aura:component >
<ui:inputText label="name" aura:id="name" placeholder="Enter your name"/>
<ui:outputText aura:id="nameoutput" value=""/>
<ui:button aura:id="buttonid" label="Submit" press="{!c.getInput}"/>
</aura:component>
****client side controller is ***
({
getinput : function(cmp , event) {
var.fullname = cmp.find("name").get("v.value");
var.outname = cmp.find("nameoutput");
outname.set("v.value",fullname+"***");
}
})
not working properly
error message is****
This page has an error. You might just need to refresh it. Component class instance initialization error [Cannot read property 'apply' of undefined] Failing descriptor: {markup://aura:application}
Javascript is case sensitive, so in your case -
Component Code -
<ui:button aura:id="buttonid" label="Submit" press="{!c.getInput}"/>
Component Controller Code -
getinput : function(component, event) {}
Note the method name written in press attribute and in the controller
Change it to getInput or getinput at both places and it will work fine.
Hope this helped you.
Thanks,
Mustafa Jhabuawala
Technical Lead at Zen4orce (http://www.zen4orce.com)
All Answers
({
getinput : function(component, event) {
var fullname = component.find("name").get("v.value");
var outname = component.find("nameoutput");
outname.set("v.value",fullname+"***");
}
})
Try this.
(when hit the submit button)error is
This page has an error. You might just need to refresh it. Unknown controller action 'getInput' Failing descriptor: {markup://devloper:uicomponent}
Javascript is case sensitive, so in your case -
Component Code -
<ui:button aura:id="buttonid" label="Submit" press="{!c.getInput}"/>
Component Controller Code -
getinput : function(component, event) {}
Note the method name written in press attribute and in the controller
Change it to getInput or getinput at both places and it will work fine.
Hope this helped you.
Thanks,
Mustafa Jhabuawala
Technical Lead at Zen4orce (http://www.zen4orce.com)
Yes this is right
Thanks!!