Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8520899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:39:41+00:00 2026-06-11T06:39:41+00:00

I am trying to call an action in a state directly when I enter

  • 0

I am trying to call an action in a state directly when I enter it. (Actually in my app I am trying to call an action on my state’s parent state, but the net result is the same.)

In my app, I transition from StateOne to StateTwo. When I enter my state, StateTwo, I call manager.send(“myStateTwoAction”). However, I immediately get an error

Uncaught Error: <Ember.StateManager:ember1424> 
  could not respond to event myStateTwoAction in state StateOne.

Note that this is in my StateTwo enter method.

Here is my jsFiddle: http://jsfiddle.net/SamFent/YGX2Y/

Does anyone know if there’s a way to call a state’s action from within the new state’s enter method?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:39:43+00:00Added an answer on June 11, 2026 at 6:39 am

    You cannot call a state action in the enter method. As you can see here: https://github.com/emberjs/ember.js/blob/master/packages/ember-states/lib/state_manager.js#L861 the currentState is set after the enter method is called.
    But you can implement the setup method witch is called just after a state has been entered.

    App.StateTwo = Ember.State.extend({
      enter: function(manager) {
        $("#states").append("<p>State two</p>");
      },
      setup: function(manager){
        manager.send("goToThree");
      },
      goToThree: function(manager) {
        $("#states").append("<p>=> going to three...</p>");
        manager.transitionTo("stateThree");
      }
    }),
    

    see: http://jsfiddle.net/YGX2Y/2/

    I hope this works for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to call submit action from javascript using simpleFormController of Spring but
Trying to call a SAP SOAP Web Service from a generated sudzc app shows
I'm trying to call a server-side action in a controller from jQuery: $.ajax({ url:'http://localhost:88/admin/business/11/GetChildBusinessTypes',
I am trying to call an action in a flash object from the javascript:
I am trying to call a controller action from a jquery UI dialog. What
In the following I am trying call action script function from js function. What
I am trying to call a Struts action from simple, standalone Java class. The
Im trying to build call to action button on my site using jQuery. I
Im trying to call a method that will add or subtract 1 from a
I trying to call 2 functions in the same page to submit jquery-ajax at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.