Note that there are some explanatory texts on larger screens.

plurals
  1. POBindable variable not updating with viewstack / swiz
    primarykey
    data
    text
    <p>I'm using the Swiz framework and I'm trying to update my viewstack's selectedIndex with a bindable property. It gets to my event handler which updates the bindable variable but the Main app file's viewstack never realizes it. What could be the issue?</p> <p>thx</p> <p>-Mike</p> <p>================================</p> <h1>MAIN APP FILE</h1> <pre><code>&lt;mx:Script&gt; &lt;![CDATA[ import reg.model.ApplicationViewModel; import beyaz.reg.swiz.SwizBeans; import org.swizframework.Swiz; [Autowire(bean="applicationViewModel")] [Bindable] public var applicationViewModel:ApplicationViewModel; private function preInitialize():void { Swiz.loadBeans( [ SwizBeans ] ); } ]]&gt; &lt;/mx:Script&gt; &lt;mx:ViewStack id="theViewstack" **selectedIndex=" {applicationViewModel.mainViewIndex}"** width="100%" height="100%"&gt; &lt;prescreen:Prescreen id="prescreenView"/&gt; &lt;login:Login id="loginView"/&gt; &lt;profile:Profile id="profileView"/&gt; &lt;/mx:ViewStack&gt; </code></pre> <p>=================================</p> <h1>ApplicationViewModel</h1> <p>package com.reg.model { public class ApplicationViewModel { public static const PRESCREEN_VIEW:int = 0; public static const LOGIN_VIEW:int = 1; public static const PRSNL_INFO_VIEW:int = 2;</p> <pre><code> [Bindable] public var message:String = ""; [Bindable] public var mainViewIndex:int = PRESCREEN_VIEW; } </code></pre> <p>}</p> <p>===========================</p> <h1>Controller</h1> <p>package com.reg.controller {</p> <pre><code>import com.reg.model.ApplicationViewModel; import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.events.DynamicEvent; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import mx.core.Application; import org.swizframework.Swiz; import org.swizframework.controller.AbstractController; public class PrescreenController// extends AbstractController { public static const START_REGISTRATION:String = "startReg"; [Autowire(bean="applicationViewModel")] [Bindable] public var applicationViewModel:ApplicationViewModel; [Mediate(event="startReg")] public function startReg():void { //CODE GETS TO HERE! applicationViewModel.mainViewIndex = ApplicationViewModel.PRSNL_INFO_VIEW; } } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload