• Christian Böhme
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hello,

I have a component, which has an aura:attribute with the type Aura.Action and a button, which calls this action.
<aura:attribute name="onproceed" type="Aura.Action" default="{!c.defaultCloseAction}"/>

<button onclick="{!v.onproceed}" />

Now I want to dynamically create this component in my controller and pass my custom action as a parameter to this component:
openWindow : function(component,event,helper) {

        $A.createComponent(
            "c:windowComponent",
            {
                "onproceed": function(){
                    alert('Success');
                }
            },
            function(window){
                if (component.isValid()) {
                    var targetCmp = component.find('windowDiv');
                    var body = targetCmp.get("v.body");
                    body.push(window);
                    targetCmp.set("v.body", body); 
                }
            }
        );
    },
There comes the error message: "action.runDeprecated is not a function".
What type of action should I pass here? Is it possible to do it with such a callback?
Do I have to pass my custom method from the controller?

A workaround for me would be to do it with events, but maybe this solution works somehow.