Skip to main content
Tweeted twitter.com/StackSalesforce/status/659430125772132352
added 113 characters in body
Source Link
Uwe Heim
  • 28.5k
  • 20
  • 121
  • 287

In Visualforce we used <apex:inputField value="{!account.name}"/> to get the html-input together with the right label (respecting transaltions, overrides, etc.)

Now in Lightnig is see a very verbose notation in the examples setting the label manually hardcoded like that:

<ui:inputText aura:id="client" 
    label="Client" 
    class="form-control"
    value="{!v.newExpense.Client__c}"
    placeholder="ABC Co."
/>

Is there a way to populate the labels dynamically like in VF?

Will anThe expression which works in Visualforce like this work in the Markup of a Lightning Component?

{!$ObjectType.Account.fields.Name.Label}

seems not to work but brings up only empty-results in the markup of a Lightning Component. However you can save the markup containing the expression without any error.

In Visualforce we used <apex:inputField value="{!account.name}"/> to get the html-input together with the right label (respecting transaltions, overrides, etc.)

Now in Lightnig is see a very verbose notation in the examples setting the label manually hardcoded like that:

<ui:inputText aura:id="client" 
    label="Client" 
    class="form-control"
    value="{!v.newExpense.Client__c}"
    placeholder="ABC Co."
/>

Is there a way to populate the labels dynamically like in VF?

Will an expression like this work in the Markup of a Lightning Component?

{!$ObjectType.Account.fields.Name.Label}

In Visualforce we used <apex:inputField value="{!account.name}"/> to get the html-input together with the right label (respecting transaltions, overrides, etc.)

Now in Lightnig is see a very verbose notation in the examples setting the label manually hardcoded like that:

<ui:inputText aura:id="client" 
    label="Client" 
    class="form-control"
    value="{!v.newExpense.Client__c}"
    placeholder="ABC Co."
/>

Is there a way to populate the labels dynamically like in VF?

The expression which works in Visualforce like this

{!$ObjectType.Account.fields.Name.Label}

seems not to work but brings up only empty-results in the markup of a Lightning Component. However you can save the markup containing the expression without any error.

Source Link
Uwe Heim
  • 28.5k
  • 20
  • 121
  • 287

How to render the corresponding field-label automatically in Lightning?

In Visualforce we used <apex:inputField value="{!account.name}"/> to get the html-input together with the right label (respecting transaltions, overrides, etc.)

Now in Lightnig is see a very verbose notation in the examples setting the label manually hardcoded like that:

<ui:inputText aura:id="client" 
    label="Client" 
    class="form-control"
    value="{!v.newExpense.Client__c}"
    placeholder="ABC Co."
/>

Is there a way to populate the labels dynamically like in VF?

Will an expression like this work in the Markup of a Lightning Component?

{!$ObjectType.Account.fields.Name.Label}