• harish reddy 37
  • 0 Points
  • Member since 2017

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 4
I'm seeking more info on lightning:input for use in a Lightning Component.

What I want to do is have the input text field submit when the user presses the Enter key. However, the Enter key seems to be ignored by lightning:input. Also, I can't even retrieve the keycode with my handler.

component markup:
                  <lightning:input aura:id="body"
                                         placeholder="Enter message..."

And my keyCheck handler:
keyCheck: function(component, event, helper){
The handler is getting called, but the value is undefined. I think it's undefined because the event that is happening is NOT the keypress/keyDown/keyUp, but rather the input field is changing. But lightning:input chokes (won't compile) if I try to add a keyDown event in its parameters in the markup.

BTW, I've tried doing this with ui:inputText as well, and that doesn't work either.

Help please?

Hi Folks,

I am having an apex class which is having AuraEnabled method which returns list of accounts to <aura:iteration >. I am not able to display the list in component.Code is very simple nothing complicated.
Need help ASAP.

<aura:component controller="Accounts">
    <aura:attribute name="Acc" type="Account[]" default="{'sObjectType':'Account',
    <aura:iteration items="{!v.Acc}" var="acc">

//Server side controller
public with sharing class Accounts {
    Public Static List<Account> getAccount(){
  return  [Select Name,id from Account LIMIT 2];