Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action from Action call makes extra pass through Default route #3

Open
wvdbosch opened this issue Nov 7, 2011 · 1 comment
Open

Comments

@wvdbosch
Copy link

wvdbosch commented Nov 7, 2011

Hi John,

Last week you posted an updated mvc.js, based on our discussion at

http://johnkalberer.com/2011/09/13/appcelerator-mvc-routing/#comment-69

This allowed for actions to be called from within an action in a controller's code. Perfect for our purposes.

However, after successfully calling and executing the action, the framework somehow proceeds to call the default routed action as well, in the background. I know it's the default, catch-all action, since I changed that value in the app.js a couple of times in my tests prior to this post. Each time, the correct action would be called, then followed up by the default action.

That default action call goes on in the background somehow, not replacing the contents of the screen. An alert snuck away in the default action's code does get shown however.

For now I'm just making the default action something harmless, but of course this is no solution.

Any idea on where the routing might go wrong? My understanding of mvc.js is insufficient to go digging in it myself.

I'd be happy to offer you more information or do some more testing though. Let me know what to do.

@wvdbosch
Copy link
Author

wvdbosch commented Nov 7, 2011

Small update. Did some fooling around in MVC.js anyway and made the following change to your revised MVC.js file, solving my issue :

Line 139
if(!view) {
To
If(!view || !view.action)

Not sure whether it'll cause me any issues down the line, but this effectively solves the double pass issue for now.

Wouter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant