Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / Architecture / Re: Need some State Machine advice on: May 09, 2013, 03:48:32
I think if I check the active state right before I do the return it will work. Didn't know this would be that easy. :) I already have an ApplicationStateProxy I am using.
2  Announcements and General Discussion / Architecture / Need some State Machine advice on: May 09, 2013, 03:23:47
Background:
I am using Haxe PureMVC with State Machine to build a web application (deployed to JavaScript). I am integrating it with a government-mandated UI framework that uses a JQuery-powered tabbed interface. The application has 4 tabs and I have created an application state for each of these tabs. The tab interface (EasyTabs) has a built-in event system which helps the integration. Clicking a tab fires an event, and if the handler for the event (in my Haxe app) returns true, only then will the tab view change.

Problem:
I want that handler to send a StateMachine.CHANGE notification and let the "Entering" command for the next tab state to do the necessary checks that ultimately cancel or approve the state transition. I'm just not sure how to send the notification and use the results of that action to return true or false so that EasyTabs gets the Boolean it requires.

Here's my current code:
:
var tabs=new JQuery("#theTabs");
tabs.bind("easytabs:before",tabHooksHandler); //setup the handler for the tab event

private function tabHooksHandler(e:Dynamic,clicked:Dynamic,targetPanel:Dynamic,settings:Dynamic):Bool{
switch(targetPanel.selector){
case"#tab1":
                    sendNotification ( StateMachine.ACTION, null, Main.ACTION_GOTO_FILE );
case"#tab2":
                    sendNotification ( StateMachine.ACTION, null, Main.ACTION_GOTO_TREES );
case"#tab3":
                    sendNotification ( StateMachine.ACTION, null, Main.ACTION_GOTO_MAP );
case"#tab4":
                    sendNotification ( StateMachine.ACTION, null, Main.ACTION_GOTO_CALCULATOR );
}
return true; //this lets EasyTabs complete the switch of tabs. If the StateMachine does a cancel, I would want this to return false.
}
So, could I use a callback somehow? Suggestions would be appreciated, thanks!
3  PureMVC Manifold / Demos and Utils / Re: Multiplatform Communications - A PureMVC Haxe / JavaScript / Flash Demo on: March 01, 2013, 02:47:06
Hi, I tried the demo on github and the Flash versions don't seem to be responding to the Send command.
http://darkstar.puremvc.org/content_header.html?url=http://puremvc.org/pages/demos/Haxe/MultiplatformComm/&desc=PureMVC%20Haxe%20Demo:%20Multi-platform%20Communications
Pages: [1]