You need to sign in to do that
Don't have an account?
Qiuyan LIU
force:inputField doesn't work
Hello, I am trying to use "force:inputField" to create type-specific input component implementation based on the data type to Create Account Record.
Here is what I did :
In cmp file :
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="account" type="Account" default="{ sobjectType: 'Account' }"/>
<force:inputField value="{!v.account.Name}" />
In Controller :
doInit: function(component, evt, helper) {
var action = component.get("c.getAccount");
action.setCallback(this, function(a) {
console.log(a.getReturnValue());
component.set("v.account", a.getReturnValue());
});
$A.enqueueAction(action);
},
I can see the v.account value if I use ui:inputText, so it is not the problem of javascript or apex code. I did not got any error, only a blank page with nothing in html markup, the javascript function is not event executed.
Please help me ! Thanks a lot
Here is what I did :
In cmp file :
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="account" type="Account" default="{ sobjectType: 'Account' }"/>
<force:inputField value="{!v.account.Name}" />
In Controller :
doInit: function(component, evt, helper) {
var action = component.get("c.getAccount");
action.setCallback(this, function(a) {
console.log(a.getReturnValue());
component.set("v.account", a.getReturnValue());
});
$A.enqueueAction(action);
},
I can see the v.account value if I use ui:inputText, so it is not the problem of javascript or apex code. I did not got any error, only a blank page with nothing in html markup, the javascript function is not event executed.
Please help me ! Thanks a lot
http://salesforce.stackexchange.com/questions/119455/lightning-component-initialization-after-redirect/131610#131610