Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <aura:component description="TestSelectW18">
- <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
- <aura:attribute name="dynamicComp" type="Aura.Component"/>
- {!v.dynamicComp}
- </aura:component>
- ({
- doInit: function (component, event, helper) {
- $A.createComponent(
- 'ui:inputSelect',
- {
- 'aura:id': 'findableAuraId',
- label: 'Test',
- required: false,
- change: {},
- options: [
- {
- class: 'optionClass',
- label: 'test1',
- value: 'test1',
- selected: 'true'
- },
- {
- class: 'optionClass',
- label: 'test2',
- value: 'test2'
- }
- ],
- multiple: 'false',
- size: 1
- },
- function (newComp, status, errorMessage) {
- if (status === 'SUCCESS' && component.isValid()) {
- component.set('v.dynamicComp', newComp);
- } else if (status === 'INCOMPLETE') {
- console.log('No response from server.');
- } else if (status === 'ERROR') {
- console.log('Error: ' + errorMessage);
- }
- }
- );
- }
- })
Add Comment
Please, Sign In to add comment