You need to sign in to do that
Don't have an account?
Florian.Gümbel
Lightning component ui:modal not working
Hey there,
I tried to use to use the aura ui:modal component as it's described in the auradoc http://documentation.auraframework.org/auradocs#reference?descriptor=ui:modal&defType=component.
I included the panelManager2 component:
Every time I call createModal, Lightning throws following error:
Seems like,
$A.get('e.ui:createPanel')
fails...
Any ideas how to get this component working?
Thanks in advance and Cheers!
Flo
I tried to use to use the aura ui:modal component as it's described in the auradoc http://documentation.auraframework.org/auradocs#reference?descriptor=ui:modal&defType=component.
I included the panelManager2 component:
<ui:panelManager2 aura:id="pm"> <aura:set attribute="registeredPanels"> <ui:panel alias="panel"/> <ui:modal alias="modal"/> </aura:set> </ui:panelManager2>
createModal : function(component, event, helper){ var body = $A.createComponent('aura:text', {value : 'TEST Content'}, function(a,b,c){}), footer = $A.createComponent('aura:text', {value : 'TEST Content'}, function(a,b,c){}) ; $A.get('e.ui:createPanel').setParams({ panelType :'modal', visible: true, panelConfig : { title: 'Modal Header', body : body, footer: footer }, onCreate: function (panel) { //need this for event bubbling footer.setAttributeValueProvider(panel); console.log('createmodal ' + panel); } }).fire(); }
Every time I call createModal, Lightning throws following error:
This page has an error. You might just need to refresh it. Action failed: c:IssuePlacementsComponent$controller$createModal [Cannot read property 'setParams' of undefined] Failing descriptor: {c:IssuePlacementsComponent$controller$createModal}
Seems like,
$A.get('e.ui:createPanel')
fails...
Any ideas how to get this component working?
Thanks in advance and Cheers!
Flo
It seems like issue is with your property 'setParams' available could you please check where this being used in your code and check your working code by removing the ui:model and then include I don't think any error you will get in the above code.
Regards,
Lokesh
thanks for your answer.
In my opinion the error source is that $A.get('e.ui:createPanel') returns undefined.
Undefined does not have properties, so this will fail.
It seems, that the modal component is currently not available in LEX..
Cheers
Kindly Check this link https://developer.salesforce.com/forums/?id=906F0000000g0q6IAA
Thanks!
Hi Lokesh,
looks like a workaround :)
Thank you!
Cheers :)