IMO, Binding is independent from states.  Even if you took out all of the 
states, if you had a binding from a non-public property, there is no way to get 
that to work dynamically at runtime (at least, not without a ton of work).  You 
should be able to generate bindings for public properties so if you can 
constrain your use of bindings for public properties, then you should be able 
to get things to work.  Instead of generating getter/setters, you have to add 
the right event listeners for changes.

HTH,
-Alex

On 10/21/19, 7:26 AM, "Ramazan Ergüder Bekrek" <e.bek...@yandex.com> wrote:

    After looking how the compiler generates MXML states as suggested by Alex 
I've discovered some important details...
    
    Let's say that I have these two UI component in my main UI.
    
    <serviceloader:UIService id="marketplace" purpose="marketplace" 
width="100%" height="100%" bottom="0" includeIn="marketplace"/>
    <serviceloader:UIService id="editor" purpose="timeline" width="100%" 
height="35%" bottom="0" includeIn="editor"/>
    
    The class that is generated automatically is this: 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpastebin.com%2Fdg93hAQv&amp;data=02%7C01%7Caharui%40adobe.com%7Ca7d7d5ee036b470b38b008d75632a36c%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C637072647800837585&amp;sdata=DvhCKVwcgSmj%2BVOjrTrNEKNfAW3IoiNN1JIv2YbvGOA%3D&amp;reserved=0
    
    As you can see also the class has this annotation 
[DynamicStateHost(name="multiverses")]
    I decided to remove all the states from the main UI to generate them 
automatically.
    I my DynamicStateHandler class that is generating the states automatically 
there is the coded inspired by the MXML compiler.
    
    I am able to achieve almost anything except the part where the compiler 
adds the getter/setter for the Bindings from line 83 to 119.
    Naturally when my state handler try to set the current state of the main UI 
to the default one : 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpastebin.com%2F3Y3C7Fi8&amp;data=02%7C01%7Caharui%40adobe.com%7Ca7d7d5ee036b470b38b008d75632a36c%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C637072647800837585&amp;sdata=F3pkuotBsCGbe3DH4nzKaG4Nd7OhN2wgAfVMS4trrz8%3D&amp;reserved=0
    
    I get this error:
    
    Property editor not found on MultiversesMainUI and there is no default 
value.
        at 
mx.states::OverrideBase/getOverrideContext()[D:\flex_sdk\Sources\flex-sdk\frameworks\projects\framework\src\mx\states\OverrideBase.as:151]
    
    Does anyone has an idea how to fix this? I've created a dynamic class which 
extends from Module and used that instead but it doesn't work neither.
    Right now I have no clue how to bypass this constraint.
    
    Best regards
    
    Ergü
    

Reply via email to