4

So what I need is to display some checkboxes with dynamic labels for some component attributes in the app builder(when you add a component to a flexipage you can configure some attributes).

First I wanted to add a multi-select picklist but looks like it is not available for <design:attribute> so now trying with checkboxes. But I need each checkbox label to correspond to some custom field label which may change and it looks that you can't use component variables or custom labels in the design. I've tried

{!$Label.c.labelName}

or

{!v.variableName}

But it does not work.

Is there a way to populate design attribute label dynamically or bind to some other thing like custom label?

  • No, I'm afraid this is currently not possible. – Kristian Jul 4 '17 at 6:04
-2

Yes, you can, but you must do it on the controller, and set some variable:

Controller.js

 var labelSubStr = 'variableNameExample';
 var labelReference = $A.getReference("$Label.c." + labelSubStr);
 // You can add here some validation, when the label doens't exists
 component.set("v.label", labelReference);

comp.cmp

<aura:attribute name="label" type="String"/> <ui:outputText value="{!v.label}" />

  • But the question was how to set a <design:attribute> – Oles Malkov Jun 30 '18 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.