Guest User

Untitled

a guest
Oct 17th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. <aura:component description="TestSelectW18">
  2. <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
  3. <aura:attribute name="dynamicComp" type="Aura.Component"/>
  4. {!v.dynamicComp}
  5. </aura:component>
  6.  
  7. ({
  8. doInit: function (component, event, helper) {
  9. $A.createComponent(
  10. 'ui:inputSelect',
  11. {
  12. 'aura:id': 'findableAuraId',
  13. label: 'Test',
  14. required: false,
  15. change: {},
  16. options: [
  17. {
  18. class: 'optionClass',
  19. label: 'test1',
  20. value: 'test1',
  21. selected: 'true'
  22. },
  23. {
  24. class: 'optionClass',
  25. label: 'test2',
  26. value: 'test2'
  27. }
  28. ],
  29. multiple: 'false',
  30. size: 1
  31. },
  32. function (newComp, status, errorMessage) {
  33. if (status === 'SUCCESS' && component.isValid()) {
  34. component.set('v.dynamicComp', newComp);
  35. } else if (status === 'INCOMPLETE') {
  36. console.log('No response from server.');
  37. } else if (status === 'ERROR') {
  38. console.log('Error: ' + errorMessage);
  39. }
  40. }
  41. );
  42. }
  43. })
Add Comment
Please, Sign In to add comment