+ Start a Discussion
Chandan Kumar 100Chandan 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}
Best Answer chosen by Chandan Kumar 100
Mustafa JhabuawalaMustafa Jhabuawala
Hi Chandan,

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

Karan Shekhar KaulKaran Shekhar Kaul
****client side controller is ***
({
    getinput : function(component, event) {
        var fullname = component.find("name").get("v.value");
        var outname = component.find("nameoutput");
        outname.set("v.value",fullname+"***");
    }
})

Try this. 
Chandan Kumar 100Chandan Kumar 100
@Karan Shekhar Kaul  it has not working properly
(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}
Mustafa JhabuawalaMustafa Jhabuawala
Hi Chandan,

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)
This was selected as the best answer
Chandan Kumar 100Chandan Kumar 100
@Mustafa Jhabuawala
Yes this is right
Thanks!!