You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by Nicolas Aguttes <ni...@gmail.com> on 2020/05/17 05:31:28 UTC

Binding question/issue

Good morning all.
I am new to Apache Royale and I don't know how to make binding work
I have my main program which call some screens (ecrans.*)
each screen has its applicationScript where I define some constant that I
would link to bind to the view, it compiles, but the binding doesn't work
and shows undefine value.
I tried with differetn combination of
 <j:beads>
        <js:nnnnDataBinding/>
    </j:beads>
but without success.

Can someone tell we what I am doing wrong?
Thanks
Nicolas

Here is a non working extract of my code
----- Main ----
<?xml version="1.0" encoding="utf-8"?>
<j:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:ecrans="ecrans.*"
xmlns:j="library://ns.apache.org/royale/jewel"
xmlns:js="library://ns.apache.org/royale/basic"
xmlns:html="library://ns.apache.org/royale/html"
width="100%"
height="100%">
   <j:beads>
        <js:ApplicationDataBinding/>
    </j:beads>
<j:initialView>
   <j:View id="vuePrincipale" width="100%" height="100%">
<j:View id="EcranBox" width="100%" height="100%">
<ecrans:Ecran1 id="Ecran1" />
    </j:View>

</j:View>
</j:initialView>
</j:Application>

----- Scren 1 .mxml  ------
<?xml version="1.0" encoding="utf-8"?>
<ecrans:Ecran1Class
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:ecrans = "ecrans.*"
xmlns:j="library://ns.apache.org/royale/jewel"
xmlns:html="library://ns.apache.org/royale/html"
xmlns:js="library://ns.apache.org/royale/basic"
    >
<j:Form width="100%" height="100%" id="searchForm"  >

<j:FormItem  id="labelNom"  label="nom :" width="100%" >
<j:TextInput id="nom" >
<j:beads>
<j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
</j:beads>
</j:TextInput>
</j:FormItem>
</j:Form>
</ecrans:Ecran1Class>


----- screen 1 .as  --------
package ecrans
{
import org.apache.royale.jewel.View;

public class Ecran1Class extends View
{
// Proprietes
[Bindable] public static const MAX_CHARS_NOM:int = 50;

// Constructeur
public function Ecran1Class()
{
super();
}
}

Re: Binding question/issue

Posted by Carlos Rovira <ca...@apache.org>.
Hi Nicolas and welcome,

here's a blog post about data binding that can help you with it:

https://royale.apache.org/binding-the-text-property-of-a-jewel-textinput-to-update-a-text-label/

At the end it links to the Royale Data Binding Docs page too.

You can check as well TDJ source code where data binding is used heavily

https://royale.apache.org/tourdejewel/
https://github.com/apache/royale-asjs/blob/develop/examples/jewel/TourDeJewel

thanks

Carlos




El dom., 17 may. 2020 a las 8:19, Alex Harui (<ah...@adobe.com>) escribió:

> Hi Nicolas,
>
>
>
> Looks like you are using the Jewel component set, so you may need to add
> ContainerDataBinding to the screens.  Different MXML files can have
> different binding implementation for performance reasons and there may not
> be one specified by default for PAYG reasons.
>
>
>
> You can do that by adding the ContainerDataBinding bead to the MXML files
> for screens where you have binding expressions in the same way you added
> ApplicationDataBinding to the main app, or if Ecran1Class is only used as
> the top tag in an MXML file, then it should be safe to just add the
> ContainerDataBinding bead in the Ecran1Class constructor.
>
>
>
> public function Ecran1Class()
> {
> super();
>
> addBead(new ContainerDataBinding());
> }
> }
>
>
>
> HTH,
>
> -Alex
>
>
>
> *From: *Nicolas Aguttes <ni...@gmail.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Saturday, May 16, 2020 at 10:31 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Binding question/issue
>
>
>
> Good morning all.
> I am new to Apache Royale and I don't know how to make binding work
> I have my main program which call some screens (ecrans.*)
> each screen has its applicationScript where I define some constant that I
> would link to bind to the view, it compiles, but the binding doesn't work
> and shows undefine value.
> I tried with differetn combination of
>  <j:beads>
>         <js:nnnnDataBinding/>
>     </j:beads>
> but without success.
>
> Can someone tell we what I am doing wrong?
> Thanks
> Nicolas
>
> Here is a non working extract of my code
> ----- Main ----
> <?xml version="1.0" encoding="utf-8"?>
> <j:Application
> xmlns:fx="http://ns.adobe.com/mxml/2009
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135709487&sdata=TAvlz%2B5UpoRVz6m2rbXYGn2Ot7ViiLw3mivUEFSY6%2Bw%3D&reserved=0>"
>
> xmlns:ecrans="ecrans.*"
> xmlns:j="library://ns.apache.org/royale/jewel
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135719481&sdata=Iyyi8hzJn2LqT4%2BkKv8S7zq8He3oPlvPUxR8ea4EVl8%3D&reserved=0>
> "
> xmlns:js="library://ns.apache.org/royale/basic
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135729485&sdata=7VkHK6SZcEHB1RfYzOJo4ilwtnxavElTbTKnwnr5kqI%3D&reserved=0>
> "
> xmlns:html="library://ns.apache.org/royale/html
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135729485&sdata=koPs87mBTCNVh0O8JCSt4M4XdxkyCXJX7VoDsQAAPTY%3D&reserved=0>
> "
> width="100%"
> height="100%">
>    <j:beads>
>         <js:ApplicationDataBinding/>
>     </j:beads>
> <j:initialView>
>    <j:View id="vuePrincipale" width="100%" height="100%">
> <j:View id="EcranBox" width="100%" height="100%">
> <ecrans:Ecran1 id="Ecran1" />
>     </j:View>
>
> </j:View>
> </j:initialView>
> </j:Application>
>
> ----- Scren 1 .mxml  ------
> <?xml version="1.0" encoding="utf-8"?>
> <ecrans:Ecran1Class
> xmlns:fx="http://ns.adobe.com/mxml/2009
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135739478&sdata=gpcSKYpvjAgJ3QSd50eZw8oNmVdOi5B5g44vYMzKFxs%3D&reserved=0>
> "
> xmlns:ecrans = "ecrans.*"
> xmlns:j="library://ns.apache.org/royale/jewel
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135739478&sdata=V8xnJIhiW%2Fos0EAO8E3tvDwBHhRG3IUEjpB3VJMroeM%3D&reserved=0>
> "
> xmlns:html="library://ns.apache.org/royale/html
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135749470&sdata=BbRImRMkckHlvS5Z1V5nhx0VFqF%2FnpoAw6LNRJzZm%2BQ%3D&reserved=0>
> "
> xmlns:js="library://ns.apache.org/royale/basic
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135749470&sdata=aj%2BOjRT9lnJRikrF3zlwxE3VtTIaUu0nBXIufeqV2mY%3D&reserved=0>
> "
>     >
> <j:Form width="100%" height="100%" id="searchForm"  >
>
> <j:FormItem  id="labelNom"  label="nom :" width="100%" >
> <j:TextInput id="nom" >
> <j:beads>
> <j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
> </j:beads>
> </j:TextInput>
> </j:FormItem>
> </j:Form>
> </ecrans:Ecran1Class>
>
>
> ----- screen 1 .as  --------
> package ecrans
> {
> import org.apache.royale.jewel.View;
>
> public class Ecran1Class extends View
> {
> // Proprietes
> [Bindable] public static const MAX_CHARS_NOM:int = 50;
>
> // Constructeur
> public function Ecran1Class()
> {
> super();
> }
> }
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Re: Binding question/issue

Posted by Nicolas Aguttes <ni...@gmail.com>.
Hello Greg,

Thanks for your answer.
I will test that.

Nicolas

Le lun. 18 mai 2020 à 13:48, Greg Dove <gr...@gmail.com> a écrit :

>
> There's a few things to take note of here.
>
> 1. If you are binding to a static constant in another class, you need to
> reference it via the other class (even if it is in ancestry). This is the
> same as actionscript. That means importing the class inside a script block.
> You don't need to use member access on the class if it is the current class
> (the mxml document class).
>
> 2. The MaxNumberCharacters bead was not set up to be a binding target (it
> was not propagating changes after startup values). I updated that, so it
> should be usable in the way you want when you either rebuild, or download
> the next nightly build (whichever you are doing).
>
> 3. For custom classes, you need to make sure you use the correct namespace
> for the class level properties. This should be the same namespace as the
> class itself.
>
> so for <ecran:Ecran1Class>
>
> you would use
> <ecran:beads> ...ContainerDataBinding bead here ...</ecran:beads>
>
>
> Here's how I tested:
>
> <ecrans:Ecran1Class xmlns:fx="http://ns.adobe.com/mxml/2009"
>     xmlns:j="library://ns.apache.org/royale/jewel"
>     xmlns:js="library://ns.apache.org/royale/basic"
>     xmlns:ecrans="ecrans.*">
>
>     <fx:Script>
>         import ecrans.Ecran1Class;
>
>         //alternative... see below
>         public static const LOCAL_MAX_CHARS_NOM:int = 25;
>     </fx:Script>
>
>     <ecrans:beads>
>         <js:ContainerDataBinding/>
>     </ecrans:beads>
>
>     <j:Form width="100%" height="100%" id="searchForm"  >
>
>         <j:FormItem  id="labelNom"  label="nom :" width="100%" >
>             <j:TextInput id="nom" >
>                 <j:beads>
>                     <j:MaxNumberCharacters
> maxlength="{Ecran1Class.MAX_CHARS_NOM}" />
>                     <!-- an alternative option below, getting the constant
> from this class -->
>                    <!-- <j:MaxNumberCharacters
> maxlength="{LOCAL_MAX_CHARS_NOM}" />-->
>                 </j:beads>
>             </j:TextInput>
>         </j:FormItem>
>     </j:Form>
> </ecrans:Ecran1Class>
>
>
> From base class:
>
> package ecrans
> {
>
> import org.apache.royale.jewel.View;
>
>     public class Ecran1Class extends View
> {
>
>         public static const MAX_CHARS_NOM:int = 25;
>
>         public function Ecran1Class()
>         {
>             super();
>         }
>
>     }
> }
>
> Hope that helps.
>
>
> On Mon, May 18, 2020 at 6:22 PM Greg Dove <gr...@gmail.com> wrote:
>
>>
>> I will try to look at this in the next few hours.
>>
>>
>> On Mon, May 18, 2020 at 6:18 PM Alex Harui <ah...@adobe.com> wrote:
>>
>>> Unfortunately, we could just have a bug in the Binding code.  My first
>>> thought when looking at the stack dump was “I wonder if we tested binding
>>> to a static const in a base class?”.  I’m hoping that folks who’ve spent
>>> more time debugging the binding code will step in and follow up with you.
>>>
>>>
>>>
>>> -Alex
>>>
>>>
>>>
>>> *From: *Nicolas Aguttes <ni...@gmail.com>
>>> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
>>> *Date: *Sunday, May 17, 2020 at 10:49 PM
>>> *To: *"users@royale.apache.org" <us...@royale.apache.org>
>>> *Subject: *Re: Binding question/issue
>>>
>>>
>>>
>>> Hello in my different tries I put [Bindable] in front of my constant
>>>
>>>
>>>
>>> [Bindable]
>>>
>>> public
>>>
>>> static
>>>
>>> const MAX_CHARS_NOM:int =
>>>
>>> 50;
>>>
>>>
>>>
>>>
>>>
>>> And the error stack disappears when I remove the [Bindable] but it
>>> doesn't solve my issue as the <j:MaxNumberCharacters
>>> maxlength="{MAX_CHARS_NOM}" /> still shows an undefined value
>>>
>>>
>>>
>>> Nicolas
>>>
>>>
>>>
>>> Le lun. 18 mai 2020 à 07:32, Alex Harui <ah...@adobe.com> a écrit :
>>>
>>> Interesting.  I wonder if @Greg Dove <gr...@gmail.com> has time to
>>> look at this.  He’s been through more of these scenarios than I have.
>>>
>>>
>>>
>>> -Alex
>>>
>>>
>>>
>>> *From: *Nicolas Aguttes <ni...@gmail.com>
>>> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
>>> *Date: *Sunday, May 17, 2020 at 10:24 PM
>>> *To: *"users@royale.apache.org" <us...@royale.apache.org>
>>> *Subject: *Re: Binding question/issue
>>>
>>>
>>>
>>> Hello Alex,
>>>
>>>
>>>
>>> this is the {MAX_CHARS_NOM} in my TextInput which is undefined and yes
>>> there is an error
>>>
>>>
>>>
>>>
>>>
>>> TypeError: this.dispatcher is undefinedSimpleBinding.js:228:3
>>>
>>>     set__strand
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/SimpleBinding.js
>>> :228
>>>
>>>     addBead
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js
>>> :120
>>>
>>>     addBead
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/HTMLElementWrapper.js
>>> :50
>>>
>>>     addBead
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
>>> :378
>>>
>>>     prepareCreatedBinding
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/DataBindingBase.js
>>> :79
>>>
>>>     initBindingsHandler
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/ViewDataBinding.js
>>> :82
>>>
>>>     <anonyme> self-hosted:844
>>>
>>>     fireListeners
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js
>>> :117
>>>
>>>     dispatchEventInternal_
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/library/closure/goog/events/eventtarget.js
>>> :382
>>>
>>>     dispatchEvent
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js
>>> :80
>>>
>>>     dispatchEvent
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js
>>> :243
>>>
>>>     addedToParent
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
>>> :70
>>>
>>>     addElement
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
>>> :405
>>>
>>>     addElement
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js
>>> :165
>>>
>>>     initializeStrandBasedObject
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
>>> :241
>>>
>>>     generateMXMLArray
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
>>> :127
>>>
>>>     generateMXMLInstances
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
>>> :271
>>>
>>>     addedToParent
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
>>> :69
>>>
>>>     addElement
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
>>> :405
>>>
>>>     addElement
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js
>>> :165
>>>
>>>     initializeStrandBasedObject
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
>>> :241
>>>
>>>     generateMXMLArray
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
>>> :127
>>>
>>>     generateMXMLInstances
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
>>> :271
>>>
>>>     addedToParent
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
>>> :69
>>>
>>>     addElement
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
>>> :144
>>>
>>>     initialize
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
>>> :295
>>>
>>>     start
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
>>> :264
>>>
>>>     <anonyme>
>>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/TestBinding.html
>>> :155
>>>
>>>
>>>
>>> Le lun. 18 mai 2020 à 07:17, Alex Harui <ah...@adobe.com> a écrit :
>>>
>>> What value is undefined?  Is there a call stack or error message?
>>>
>>>
>>>
>>> -Alex
>>>
>>>
>>>
>>> *From: *Nicolas Aguttes <ni...@gmail.com>
>>> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
>>> *Date: *Sunday, May 17, 2020 at 10:09 PM
>>> *To: *"users@royale.apache.org" <us...@royale.apache.org>
>>> *Subject: *Re: Binding question/issue
>>>
>>>
>>>
>>> Hello Alex,
>>>
>>> Thanks for your reply, I tried what you suggested and added addBead(new
>>> ContainerDataBinding()) to the constructor, I also tried to add to the
>>> Ecran1.mxml the
>>> <j:beads>
>>> <js:ContainerDataBinding/>
>>> </j:beads>
>>>
>>> And read the different example provided Carlos and tried to mimic
>>> them,but I still get an undefined
>>> value when I execute the application.
>>>
>>>
>>>
>>> Le dim. 17 mai 2020 à 08:19, Alex Harui <ah...@adobe.com> a écrit :
>>>
>>> Hi Nicolas,
>>>
>>>
>>>
>>> Looks like you are using the Jewel component set, so you may need to add
>>> ContainerDataBinding to the screens.  Different MXML files can have
>>> different binding implementation for performance reasons and there may not
>>> be one specified by default for PAYG reasons.
>>>
>>>
>>>
>>> You can do that by adding the ContainerDataBinding bead to the MXML
>>> files for screens where you have binding expressions in the same way you
>>> added ApplicationDataBinding to the main app, or if Ecran1Class is only
>>> used as the top tag in an MXML file, then it should be safe to just add the
>>> ContainerDataBinding bead in the Ecran1Class constructor.
>>>
>>>
>>>
>>> public function Ecran1Class()
>>> {
>>> super();
>>>
>>> addBead(new ContainerDataBinding());
>>> }
>>> }
>>>
>>>
>>>
>>> HTH,
>>>
>>> -Alex
>>>
>>>
>>>
>>> *From: *Nicolas Aguttes <ni...@gmail.com>
>>> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
>>> *Date: *Saturday, May 16, 2020 at 10:31 PM
>>> *To: *"users@royale.apache.org" <us...@royale.apache.org>
>>> *Subject: *Binding question/issue
>>>
>>>
>>>
>>> Good morning all.
>>> I am new to Apache Royale and I don't know how to make binding work
>>> I have my main program which call some screens (ecrans.*)
>>> each screen has its applicationScript where I define some constant that
>>> I would link to bind to the view, it compiles, but the binding doesn't work
>>> and shows undefine value.
>>> I tried with differetn combination of
>>>  <j:beads>
>>>         <js:nnnnDataBinding/>
>>>     </j:beads>
>>> but without success.
>>>
>>> Can someone tell we what I am doing wrong?
>>> Thanks
>>> Nicolas
>>>
>>> Here is a non working extract of my code
>>> ----- Main ----
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <j:Application
>>> xmlns:fx="http://ns.adobe.com/mxml/2009
>>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955808572&sdata=c921nVJQ7u3iaEa9dd90PlvLZFPBQv5yuQ%2FsHE4SYOM%3D&reserved=0>"
>>>
>>> xmlns:ecrans="ecrans.*"
>>> xmlns:j="library://ns.apache.org/royale/jewel
>>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955818567&sdata=kMfzaPRmkwDtNnwBpfkXRbYJFIdjUFe2SG9WsC3rWTs%3D&reserved=0>
>>> "
>>> xmlns:js="library://ns.apache.org/royale/basic
>>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955818567&sdata=l2WhZz75FeapqIJ21QkCZCo7qeDq8q7%2FnDUWNkJicjo%3D&reserved=0>
>>> "
>>> xmlns:html="library://ns.apache.org/royale/html
>>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955828561&sdata=FSxFBfXTWw%2F1z637bU%2BzSJIzneEhBQV%2FlLHgIwBVWfo%3D&reserved=0>
>>> "
>>> width="100%"
>>> height="100%">
>>>    <j:beads>
>>>         <js:ApplicationDataBinding/>
>>>     </j:beads>
>>> <j:initialView>
>>>    <j:View id="vuePrincipale" width="100%" height="100%">
>>> <j:View id="EcranBox" width="100%" height="100%">
>>> <ecrans:Ecran1 id="Ecran1" />
>>>     </j:View>
>>>
>>> </j:View>
>>> </j:initialView>
>>> </j:Application>
>>>
>>> ----- Scren 1 .mxml  ------
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <ecrans:Ecran1Class
>>> xmlns:fx="http://ns.adobe.com/mxml/2009
>>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955828561&sdata=jkvBTJc0hr87M0L2ZeMBr6xjzMIk7t6YfB6ll9rJt0A%3D&reserved=0>
>>> "
>>> xmlns:ecrans = "ecrans.*"
>>> xmlns:j="library://ns.apache.org/royale/jewel
>>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955838559&sdata=WYYtseVJsjkkAQhKMTfSfst2GfjW5AYODm9Ko6oUJSU%3D&reserved=0>
>>> "
>>> xmlns:html="library://ns.apache.org/royale/html
>>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955838559&sdata=4gMaR%2Fl2n5Bhiuqgvkdzzvuc7Rbn3r1nNFEiv3P2YbU%3D&reserved=0>
>>> "
>>> xmlns:js="library://ns.apache.org/royale/basic
>>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955848550&sdata=X9uLXFm4Bgb0%2BBi6hT9pCPR2Aa2xQoGz3Rd1p71%2B%2FLU%3D&reserved=0>
>>> "
>>>     >
>>> <j:Form width="100%" height="100%" id="searchForm"  >
>>>
>>> <j:FormItem  id="labelNom"  label="nom :" width="100%" >
>>> <j:TextInput id="nom" >
>>> <j:beads>
>>> <j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
>>> </j:beads>
>>> </j:TextInput>
>>> </j:FormItem>
>>> </j:Form>
>>> </ecrans:Ecran1Class>
>>>
>>>
>>> ----- screen 1 .as  --------
>>> package ecrans
>>> {
>>> import org.apache.royale.jewel.View;
>>>
>>> public class Ecran1Class extends View
>>> {
>>> // Proprietes
>>> [Bindable] public static const MAX_CHARS_NOM:int = 50;
>>>
>>> // Constructeur
>>> public function Ecran1Class()
>>> {
>>> super();
>>> }
>>> }
>>>
>>>

Re: Binding question/issue

Posted by Greg Dove <gr...@gmail.com>.
There's a few things to take note of here.

1. If you are binding to a static constant in another class, you need to
reference it via the other class (even if it is in ancestry). This is the
same as actionscript. That means importing the class inside a script block.
You don't need to use member access on the class if it is the current class
(the mxml document class).

2. The MaxNumberCharacters bead was not set up to be a binding target (it
was not propagating changes after startup values). I updated that, so it
should be usable in the way you want when you either rebuild, or download
the next nightly build (whichever you are doing).

3. For custom classes, you need to make sure you use the correct namespace
for the class level properties. This should be the same namespace as the
class itself.

so for <ecran:Ecran1Class>

you would use
<ecran:beads> ...ContainerDataBinding bead here ...</ecran:beads>


Here's how I tested:

<ecrans:Ecran1Class xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:j="library://ns.apache.org/royale/jewel"
    xmlns:js="library://ns.apache.org/royale/basic"
    xmlns:ecrans="ecrans.*">

    <fx:Script>
        import ecrans.Ecran1Class;

        //alternative... see below
        public static const LOCAL_MAX_CHARS_NOM:int = 25;
    </fx:Script>

    <ecrans:beads>
        <js:ContainerDataBinding/>
    </ecrans:beads>

    <j:Form width="100%" height="100%" id="searchForm"  >

        <j:FormItem  id="labelNom"  label="nom :" width="100%" >
            <j:TextInput id="nom" >
                <j:beads>
                    <j:MaxNumberCharacters
maxlength="{Ecran1Class.MAX_CHARS_NOM}" />
                    <!-- an alternative option below, getting the constant
from this class -->
                   <!-- <j:MaxNumberCharacters
maxlength="{LOCAL_MAX_CHARS_NOM}" />-->
                </j:beads>
            </j:TextInput>
        </j:FormItem>
    </j:Form>
</ecrans:Ecran1Class>


From base class:

package ecrans
{

import org.apache.royale.jewel.View;

    public class Ecran1Class extends View
{

        public static const MAX_CHARS_NOM:int = 25;

        public function Ecran1Class()
        {
            super();
        }

    }
}

Hope that helps.


On Mon, May 18, 2020 at 6:22 PM Greg Dove <gr...@gmail.com> wrote:

>
> I will try to look at this in the next few hours.
>
>
> On Mon, May 18, 2020 at 6:18 PM Alex Harui <ah...@adobe.com> wrote:
>
>> Unfortunately, we could just have a bug in the Binding code.  My first
>> thought when looking at the stack dump was “I wonder if we tested binding
>> to a static const in a base class?”.  I’m hoping that folks who’ve spent
>> more time debugging the binding code will step in and follow up with you.
>>
>>
>>
>> -Alex
>>
>>
>>
>> *From: *Nicolas Aguttes <ni...@gmail.com>
>> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
>> *Date: *Sunday, May 17, 2020 at 10:49 PM
>> *To: *"users@royale.apache.org" <us...@royale.apache.org>
>> *Subject: *Re: Binding question/issue
>>
>>
>>
>> Hello in my different tries I put [Bindable] in front of my constant
>>
>>
>>
>> [Bindable]
>>
>> public
>>
>> static
>>
>> const MAX_CHARS_NOM:int =
>>
>> 50;
>>
>>
>>
>>
>>
>> And the error stack disappears when I remove the [Bindable] but it
>> doesn't solve my issue as the <j:MaxNumberCharacters
>> maxlength="{MAX_CHARS_NOM}" /> still shows an undefined value
>>
>>
>>
>> Nicolas
>>
>>
>>
>> Le lun. 18 mai 2020 à 07:32, Alex Harui <ah...@adobe.com> a écrit :
>>
>> Interesting.  I wonder if @Greg Dove <gr...@gmail.com> has time to
>> look at this.  He’s been through more of these scenarios than I have.
>>
>>
>>
>> -Alex
>>
>>
>>
>> *From: *Nicolas Aguttes <ni...@gmail.com>
>> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
>> *Date: *Sunday, May 17, 2020 at 10:24 PM
>> *To: *"users@royale.apache.org" <us...@royale.apache.org>
>> *Subject: *Re: Binding question/issue
>>
>>
>>
>> Hello Alex,
>>
>>
>>
>> this is the {MAX_CHARS_NOM} in my TextInput which is undefined and yes
>> there is an error
>>
>>
>>
>>
>>
>> TypeError: this.dispatcher is undefinedSimpleBinding.js:228:3
>>
>>     set__strand
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/SimpleBinding.js
>> :228
>>
>>     addBead
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js
>> :120
>>
>>     addBead
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/HTMLElementWrapper.js
>> :50
>>
>>     addBead
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
>> :378
>>
>>     prepareCreatedBinding
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/DataBindingBase.js
>> :79
>>
>>     initBindingsHandler
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/ViewDataBinding.js
>> :82
>>
>>     <anonyme> self-hosted:844
>>
>>     fireListeners
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js
>> :117
>>
>>     dispatchEventInternal_
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/library/closure/goog/events/eventtarget.js
>> :382
>>
>>     dispatchEvent
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js
>> :80
>>
>>     dispatchEvent
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js
>> :243
>>
>>     addedToParent
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
>> :70
>>
>>     addElement
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
>> :405
>>
>>     addElement
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js
>> :165
>>
>>     initializeStrandBasedObject
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
>> :241
>>
>>     generateMXMLArray
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
>> :127
>>
>>     generateMXMLInstances
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
>> :271
>>
>>     addedToParent
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
>> :69
>>
>>     addElement
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
>> :405
>>
>>     addElement
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js
>> :165
>>
>>     initializeStrandBasedObject
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
>> :241
>>
>>     generateMXMLArray
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
>> :127
>>
>>     generateMXMLInstances
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
>> :271
>>
>>     addedToParent
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
>> :69
>>
>>     addElement
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
>> :144
>>
>>     initialize
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
>> :295
>>
>>     start
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
>> :264
>>
>>     <anonyme>
>> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/TestBinding.html
>> :155
>>
>>
>>
>> Le lun. 18 mai 2020 à 07:17, Alex Harui <ah...@adobe.com> a écrit :
>>
>> What value is undefined?  Is there a call stack or error message?
>>
>>
>>
>> -Alex
>>
>>
>>
>> *From: *Nicolas Aguttes <ni...@gmail.com>
>> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
>> *Date: *Sunday, May 17, 2020 at 10:09 PM
>> *To: *"users@royale.apache.org" <us...@royale.apache.org>
>> *Subject: *Re: Binding question/issue
>>
>>
>>
>> Hello Alex,
>>
>> Thanks for your reply, I tried what you suggested and added addBead(new
>> ContainerDataBinding()) to the constructor, I also tried to add to the
>> Ecran1.mxml the
>> <j:beads>
>> <js:ContainerDataBinding/>
>> </j:beads>
>>
>> And read the different example provided Carlos and tried to mimic
>> them,but I still get an undefined
>> value when I execute the application.
>>
>>
>>
>> Le dim. 17 mai 2020 à 08:19, Alex Harui <ah...@adobe.com> a écrit :
>>
>> Hi Nicolas,
>>
>>
>>
>> Looks like you are using the Jewel component set, so you may need to add
>> ContainerDataBinding to the screens.  Different MXML files can have
>> different binding implementation for performance reasons and there may not
>> be one specified by default for PAYG reasons.
>>
>>
>>
>> You can do that by adding the ContainerDataBinding bead to the MXML files
>> for screens where you have binding expressions in the same way you added
>> ApplicationDataBinding to the main app, or if Ecran1Class is only used as
>> the top tag in an MXML file, then it should be safe to just add the
>> ContainerDataBinding bead in the Ecran1Class constructor.
>>
>>
>>
>> public function Ecran1Class()
>> {
>> super();
>>
>> addBead(new ContainerDataBinding());
>> }
>> }
>>
>>
>>
>> HTH,
>>
>> -Alex
>>
>>
>>
>> *From: *Nicolas Aguttes <ni...@gmail.com>
>> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
>> *Date: *Saturday, May 16, 2020 at 10:31 PM
>> *To: *"users@royale.apache.org" <us...@royale.apache.org>
>> *Subject: *Binding question/issue
>>
>>
>>
>> Good morning all.
>> I am new to Apache Royale and I don't know how to make binding work
>> I have my main program which call some screens (ecrans.*)
>> each screen has its applicationScript where I define some constant that I
>> would link to bind to the view, it compiles, but the binding doesn't work
>> and shows undefine value.
>> I tried with differetn combination of
>>  <j:beads>
>>         <js:nnnnDataBinding/>
>>     </j:beads>
>> but without success.
>>
>> Can someone tell we what I am doing wrong?
>> Thanks
>> Nicolas
>>
>> Here is a non working extract of my code
>> ----- Main ----
>> <?xml version="1.0" encoding="utf-8"?>
>> <j:Application
>> xmlns:fx="http://ns.adobe.com/mxml/2009
>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955808572&sdata=c921nVJQ7u3iaEa9dd90PlvLZFPBQv5yuQ%2FsHE4SYOM%3D&reserved=0>"
>>
>> xmlns:ecrans="ecrans.*"
>> xmlns:j="library://ns.apache.org/royale/jewel
>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955818567&sdata=kMfzaPRmkwDtNnwBpfkXRbYJFIdjUFe2SG9WsC3rWTs%3D&reserved=0>
>> "
>> xmlns:js="library://ns.apache.org/royale/basic
>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955818567&sdata=l2WhZz75FeapqIJ21QkCZCo7qeDq8q7%2FnDUWNkJicjo%3D&reserved=0>
>> "
>> xmlns:html="library://ns.apache.org/royale/html
>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955828561&sdata=FSxFBfXTWw%2F1z637bU%2BzSJIzneEhBQV%2FlLHgIwBVWfo%3D&reserved=0>
>> "
>> width="100%"
>> height="100%">
>>    <j:beads>
>>         <js:ApplicationDataBinding/>
>>     </j:beads>
>> <j:initialView>
>>    <j:View id="vuePrincipale" width="100%" height="100%">
>> <j:View id="EcranBox" width="100%" height="100%">
>> <ecrans:Ecran1 id="Ecran1" />
>>     </j:View>
>>
>> </j:View>
>> </j:initialView>
>> </j:Application>
>>
>> ----- Scren 1 .mxml  ------
>> <?xml version="1.0" encoding="utf-8"?>
>> <ecrans:Ecran1Class
>> xmlns:fx="http://ns.adobe.com/mxml/2009
>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955828561&sdata=jkvBTJc0hr87M0L2ZeMBr6xjzMIk7t6YfB6ll9rJt0A%3D&reserved=0>
>> "
>> xmlns:ecrans = "ecrans.*"
>> xmlns:j="library://ns.apache.org/royale/jewel
>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955838559&sdata=WYYtseVJsjkkAQhKMTfSfst2GfjW5AYODm9Ko6oUJSU%3D&reserved=0>
>> "
>> xmlns:html="library://ns.apache.org/royale/html
>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955838559&sdata=4gMaR%2Fl2n5Bhiuqgvkdzzvuc7Rbn3r1nNFEiv3P2YbU%3D&reserved=0>
>> "
>> xmlns:js="library://ns.apache.org/royale/basic
>> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955848550&sdata=X9uLXFm4Bgb0%2BBi6hT9pCPR2Aa2xQoGz3Rd1p71%2B%2FLU%3D&reserved=0>
>> "
>>     >
>> <j:Form width="100%" height="100%" id="searchForm"  >
>>
>> <j:FormItem  id="labelNom"  label="nom :" width="100%" >
>> <j:TextInput id="nom" >
>> <j:beads>
>> <j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
>> </j:beads>
>> </j:TextInput>
>> </j:FormItem>
>> </j:Form>
>> </ecrans:Ecran1Class>
>>
>>
>> ----- screen 1 .as  --------
>> package ecrans
>> {
>> import org.apache.royale.jewel.View;
>>
>> public class Ecran1Class extends View
>> {
>> // Proprietes
>> [Bindable] public static const MAX_CHARS_NOM:int = 50;
>>
>> // Constructeur
>> public function Ecran1Class()
>> {
>> super();
>> }
>> }
>>
>>

Re: Binding question/issue

Posted by Greg Dove <gr...@gmail.com>.
I will try to look at this in the next few hours.


On Mon, May 18, 2020 at 6:18 PM Alex Harui <ah...@adobe.com> wrote:

> Unfortunately, we could just have a bug in the Binding code.  My first
> thought when looking at the stack dump was “I wonder if we tested binding
> to a static const in a base class?”.  I’m hoping that folks who’ve spent
> more time debugging the binding code will step in and follow up with you.
>
>
>
> -Alex
>
>
>
> *From: *Nicolas Aguttes <ni...@gmail.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Sunday, May 17, 2020 at 10:49 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Re: Binding question/issue
>
>
>
> Hello in my different tries I put [Bindable] in front of my constant
>
>
>
> [Bindable]
>
> public
>
> static
>
> const MAX_CHARS_NOM:int =
>
> 50;
>
>
>
>
>
> And the error stack disappears when I remove the [Bindable] but it doesn't
> solve my issue as the <j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
> still shows an undefined value
>
>
>
> Nicolas
>
>
>
> Le lun. 18 mai 2020 à 07:32, Alex Harui <ah...@adobe.com> a écrit :
>
> Interesting.  I wonder if @Greg Dove <gr...@gmail.com> has time to
> look at this.  He’s been through more of these scenarios than I have.
>
>
>
> -Alex
>
>
>
> *From: *Nicolas Aguttes <ni...@gmail.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Sunday, May 17, 2020 at 10:24 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Re: Binding question/issue
>
>
>
> Hello Alex,
>
>
>
> this is the {MAX_CHARS_NOM} in my TextInput which is undefined and yes
> there is an error
>
>
>
>
>
> TypeError: this.dispatcher is undefinedSimpleBinding.js:228:3
>
>     set__strand
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/SimpleBinding.js
> :228
>
>     addBead
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js
> :120
>
>     addBead
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/HTMLElementWrapper.js
> :50
>
>     addBead
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
> :378
>
>     prepareCreatedBinding
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/DataBindingBase.js
> :79
>
>     initBindingsHandler
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/ViewDataBinding.js
> :82
>
>     <anonyme> self-hosted:844
>
>     fireListeners
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js
> :117
>
>     dispatchEventInternal_
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/library/closure/goog/events/eventtarget.js
> :382
>
>     dispatchEvent
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js
> :80
>
>     dispatchEvent
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js
> :243
>
>     addedToParent
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
> :70
>
>     addElement
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
> :405
>
>     addElement
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js
> :165
>
>     initializeStrandBasedObject
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
> :241
>
>     generateMXMLArray
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
> :127
>
>     generateMXMLInstances
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
> :271
>
>     addedToParent
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
> :69
>
>     addElement
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
> :405
>
>     addElement
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js
> :165
>
>     initializeStrandBasedObject
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
> :241
>
>     generateMXMLArray
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
> :127
>
>     generateMXMLInstances
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
> :271
>
>     addedToParent
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
> :69
>
>     addElement
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
> :144
>
>     initialize
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
> :295
>
>     start
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
> :264
>
>     <anonyme>
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/TestBinding.html
> :155
>
>
>
> Le lun. 18 mai 2020 à 07:17, Alex Harui <ah...@adobe.com> a écrit :
>
> What value is undefined?  Is there a call stack or error message?
>
>
>
> -Alex
>
>
>
> *From: *Nicolas Aguttes <ni...@gmail.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Sunday, May 17, 2020 at 10:09 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Re: Binding question/issue
>
>
>
> Hello Alex,
>
> Thanks for your reply, I tried what you suggested and added addBead(new
> ContainerDataBinding()) to the constructor, I also tried to add to the
> Ecran1.mxml the
> <j:beads>
> <js:ContainerDataBinding/>
> </j:beads>
>
> And read the different example provided Carlos and tried to mimic them,but
> I still get an undefined
> value when I execute the application.
>
>
>
> Le dim. 17 mai 2020 à 08:19, Alex Harui <ah...@adobe.com> a écrit :
>
> Hi Nicolas,
>
>
>
> Looks like you are using the Jewel component set, so you may need to add
> ContainerDataBinding to the screens.  Different MXML files can have
> different binding implementation for performance reasons and there may not
> be one specified by default for PAYG reasons.
>
>
>
> You can do that by adding the ContainerDataBinding bead to the MXML files
> for screens where you have binding expressions in the same way you added
> ApplicationDataBinding to the main app, or if Ecran1Class is only used as
> the top tag in an MXML file, then it should be safe to just add the
> ContainerDataBinding bead in the Ecran1Class constructor.
>
>
>
> public function Ecran1Class()
> {
> super();
>
> addBead(new ContainerDataBinding());
> }
> }
>
>
>
> HTH,
>
> -Alex
>
>
>
> *From: *Nicolas Aguttes <ni...@gmail.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Saturday, May 16, 2020 at 10:31 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Binding question/issue
>
>
>
> Good morning all.
> I am new to Apache Royale and I don't know how to make binding work
> I have my main program which call some screens (ecrans.*)
> each screen has its applicationScript where I define some constant that I
> would link to bind to the view, it compiles, but the binding doesn't work
> and shows undefine value.
> I tried with differetn combination of
>  <j:beads>
>         <js:nnnnDataBinding/>
>     </j:beads>
> but without success.
>
> Can someone tell we what I am doing wrong?
> Thanks
> Nicolas
>
> Here is a non working extract of my code
> ----- Main ----
> <?xml version="1.0" encoding="utf-8"?>
> <j:Application
> xmlns:fx="http://ns.adobe.com/mxml/2009
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955808572&sdata=c921nVJQ7u3iaEa9dd90PlvLZFPBQv5yuQ%2FsHE4SYOM%3D&reserved=0>"
>
> xmlns:ecrans="ecrans.*"
> xmlns:j="library://ns.apache.org/royale/jewel
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955818567&sdata=kMfzaPRmkwDtNnwBpfkXRbYJFIdjUFe2SG9WsC3rWTs%3D&reserved=0>
> "
> xmlns:js="library://ns.apache.org/royale/basic
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955818567&sdata=l2WhZz75FeapqIJ21QkCZCo7qeDq8q7%2FnDUWNkJicjo%3D&reserved=0>
> "
> xmlns:html="library://ns.apache.org/royale/html
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955828561&sdata=FSxFBfXTWw%2F1z637bU%2BzSJIzneEhBQV%2FlLHgIwBVWfo%3D&reserved=0>
> "
> width="100%"
> height="100%">
>    <j:beads>
>         <js:ApplicationDataBinding/>
>     </j:beads>
> <j:initialView>
>    <j:View id="vuePrincipale" width="100%" height="100%">
> <j:View id="EcranBox" width="100%" height="100%">
> <ecrans:Ecran1 id="Ecran1" />
>     </j:View>
>
> </j:View>
> </j:initialView>
> </j:Application>
>
> ----- Scren 1 .mxml  ------
> <?xml version="1.0" encoding="utf-8"?>
> <ecrans:Ecran1Class
> xmlns:fx="http://ns.adobe.com/mxml/2009
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955828561&sdata=jkvBTJc0hr87M0L2ZeMBr6xjzMIk7t6YfB6ll9rJt0A%3D&reserved=0>
> "
> xmlns:ecrans = "ecrans.*"
> xmlns:j="library://ns.apache.org/royale/jewel
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955838559&sdata=WYYtseVJsjkkAQhKMTfSfst2GfjW5AYODm9Ko6oUJSU%3D&reserved=0>
> "
> xmlns:html="library://ns.apache.org/royale/html
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955838559&sdata=4gMaR%2Fl2n5Bhiuqgvkdzzvuc7Rbn3r1nNFEiv3P2YbU%3D&reserved=0>
> "
> xmlns:js="library://ns.apache.org/royale/basic
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955848550&sdata=X9uLXFm4Bgb0%2BBi6hT9pCPR2Aa2xQoGz3Rd1p71%2B%2FLU%3D&reserved=0>
> "
>     >
> <j:Form width="100%" height="100%" id="searchForm"  >
>
> <j:FormItem  id="labelNom"  label="nom :" width="100%" >
> <j:TextInput id="nom" >
> <j:beads>
> <j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
> </j:beads>
> </j:TextInput>
> </j:FormItem>
> </j:Form>
> </ecrans:Ecran1Class>
>
>
> ----- screen 1 .as  --------
> package ecrans
> {
> import org.apache.royale.jewel.View;
>
> public class Ecran1Class extends View
> {
> // Proprietes
> [Bindable] public static const MAX_CHARS_NOM:int = 50;
>
> // Constructeur
> public function Ecran1Class()
> {
> super();
> }
> }
>
>

Re: Binding question/issue

Posted by Alex Harui <ah...@adobe.com>.
Unfortunately, we could just have a bug in the Binding code.  My first thought when looking at the stack dump was “I wonder if we tested binding to a static const in a base class?”.  I’m hoping that folks who’ve spent more time debugging the binding code will step in and follow up with you.

-Alex

From: Nicolas Aguttes <ni...@gmail.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Sunday, May 17, 2020 at 10:49 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: Re: Binding question/issue

Hello in my different tries I put [Bindable] in front of my constant

[Bindable]
public
static
const MAX_CHARS_NOM:int =
50;


And the error stack disappears when I remove the [Bindable] but it doesn't solve my issue as the <j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" /> still shows an undefined value

Nicolas

Le lun. 18 mai 2020 à 07:32, Alex Harui <ah...@adobe.com>> a écrit :
Interesting.  I wonder if @Greg Dove<ma...@gmail.com> has time to look at this.  He’s been through more of these scenarios than I have.

-Alex

From: Nicolas Aguttes <ni...@gmail.com>>
Reply-To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Date: Sunday, May 17, 2020 at 10:24 PM
To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Subject: Re: Binding question/issue

Hello Alex,

this is the {MAX_CHARS_NOM} in my TextInput which is undefined and yes there is an error


TypeError: this.dispatcher is undefinedSimpleBinding.js:228:3
    set__strand file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/SimpleBinding.js:228
    addBead file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js:120
    addBead file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/HTMLElementWrapper.js:50
    addBead file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js:378
    prepareCreatedBinding file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/DataBindingBase.js:79
    initBindingsHandler file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/ViewDataBinding.js:82
    <anonyme> self-hosted:844
    fireListeners file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js:117
    dispatchEventInternal_ file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/library/closure/goog/events/eventtarget.js:382
    dispatchEvent file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js:80
    dispatchEvent file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js:243
    addedToParent file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js:70
    addElement file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js:405
    addElement file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js:165
    initializeStrandBasedObject file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js:241
    generateMXMLArray file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js:127
    generateMXMLInstances file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js:271
    addedToParent file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js:69
    addElement file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js:405
    addElement file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js:165
    initializeStrandBasedObject file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js:241
    generateMXMLArray file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js:127
    generateMXMLInstances file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js:271
    addedToParent file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js:69
    addElement file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js:144
    initialize file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js:295
    start file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js:264
    <anonyme> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/TestBinding.html:155

Le lun. 18 mai 2020 à 07:17, Alex Harui <ah...@adobe.com>> a écrit :
What value is undefined?  Is there a call stack or error message?

-Alex

From: Nicolas Aguttes <ni...@gmail.com>>
Reply-To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Date: Sunday, May 17, 2020 at 10:09 PM
To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Subject: Re: Binding question/issue

Hello Alex,

Thanks for your reply, I tried what you suggested and added addBead(new
ContainerDataBinding()) to the constructor, I also tried to add to the
Ecran1.mxml the
<j:beads>
<js:ContainerDataBinding/>
</j:beads>

And read the different example provided Carlos and tried to mimic them,but I still get an undefined
value when I execute the application.

Le dim. 17 mai 2020 à 08:19, Alex Harui <ah...@adobe.com>> a écrit :
Hi Nicolas,

Looks like you are using the Jewel component set, so you may need to add ContainerDataBinding to the screens.  Different MXML files can have different binding implementation for performance reasons and there may not be one specified by default for PAYG reasons.

You can do that by adding the ContainerDataBinding bead to the MXML files for screens where you have binding expressions in the same way you added ApplicationDataBinding to the main app, or if Ecran1Class is only used as the top tag in an MXML file, then it should be safe to just add the ContainerDataBinding bead in the Ecran1Class constructor.

public function Ecran1Class()
{
super();
addBead(new ContainerDataBinding());
}
}

HTH,
-Alex

From: Nicolas Aguttes <ni...@gmail.com>>
Reply-To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Date: Saturday, May 16, 2020 at 10:31 PM
To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Subject: Binding question/issue

Good morning all.
I am new to Apache Royale and I don't know how to make binding work
I have my main program which call some screens (ecrans.*)
each screen has its applicationScript where I define some constant that I would link to bind to the view, it compiles, but the binding doesn't work and shows undefine value.
I tried with differetn combination of
 <j:beads>
        <js:nnnnDataBinding/>
    </j:beads>
but without success.

Can someone tell we what I am doing wrong?
Thanks
Nicolas

Here is a non working extract of my code
----- Main ----
<?xml version="1.0" encoding="utf-8"?>
<j:Application
xmlns:fx="http://ns.adobe.com/mxml/2009<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955808572&sdata=c921nVJQ7u3iaEa9dd90PlvLZFPBQv5yuQ%2FsHE4SYOM%3D&reserved=0>"
xmlns:ecrans="ecrans.*"
xmlns:j="library://ns.apache.org/royale/jewel<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955818567&sdata=kMfzaPRmkwDtNnwBpfkXRbYJFIdjUFe2SG9WsC3rWTs%3D&reserved=0>"
xmlns:js="library://ns.apache.org/royale/basic<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955818567&sdata=l2WhZz75FeapqIJ21QkCZCo7qeDq8q7%2FnDUWNkJicjo%3D&reserved=0>"
xmlns:html="library://ns.apache.org/royale/html<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955828561&sdata=FSxFBfXTWw%2F1z637bU%2BzSJIzneEhBQV%2FlLHgIwBVWfo%3D&reserved=0>"
width="100%"
height="100%">
   <j:beads>
        <js:ApplicationDataBinding/>
    </j:beads>
<j:initialView>
   <j:View id="vuePrincipale" width="100%" height="100%">
<j:View id="EcranBox" width="100%" height="100%">
<ecrans:Ecran1 id="Ecran1" />
    </j:View>

</j:View>
</j:initialView>
</j:Application>

----- Scren 1 .mxml  ------
<?xml version="1.0" encoding="utf-8"?>
<ecrans:Ecran1Class
xmlns:fx="http://ns.adobe.com/mxml/2009<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955828561&sdata=jkvBTJc0hr87M0L2ZeMBr6xjzMIk7t6YfB6ll9rJt0A%3D&reserved=0>"
xmlns:ecrans = "ecrans.*"
xmlns:j="library://ns.apache.org/royale/jewel<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955838559&sdata=WYYtseVJsjkkAQhKMTfSfst2GfjW5AYODm9Ko6oUJSU%3D&reserved=0>"
xmlns:html="library://ns.apache.org/royale/html<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955838559&sdata=4gMaR%2Fl2n5Bhiuqgvkdzzvuc7Rbn3r1nNFEiv3P2YbU%3D&reserved=0>"
xmlns:js="library://ns.apache.org/royale/basic<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C05689a9f276e48c7bb8a08d7faef49a5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253777955848550&sdata=X9uLXFm4Bgb0%2BBi6hT9pCPR2Aa2xQoGz3Rd1p71%2B%2FLU%3D&reserved=0>"
    >
<j:Form width="100%" height="100%" id="searchForm"  >

<j:FormItem  id="labelNom"  label="nom :" width="100%" >
<j:TextInput id="nom" >
<j:beads>
<j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
</j:beads>
</j:TextInput>
</j:FormItem>
</j:Form>
</ecrans:Ecran1Class>


----- screen 1 .as  --------
package ecrans
{
import org.apache.royale.jewel.View;

public class Ecran1Class extends View
{
// Proprietes
[Bindable] public static const MAX_CHARS_NOM:int = 50;

// Constructeur
public function Ecran1Class()
{
super();
}
}

Re: Binding question/issue

Posted by Nicolas Aguttes <ni...@gmail.com>.
Hello in my different tries I put [Bindable] in front of my constant
[Bindable] public static const MAX_CHARS_NOM:int = 50;
And the error stack disappears when I remove the [Bindable] but it doesn't
solve my issue as the <j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
still shows an undefined value

Nicolas

Le lun. 18 mai 2020 à 07:32, Alex Harui <ah...@adobe.com> a écrit :

> Interesting.  I wonder if @Greg Dove <gr...@gmail.com> has time to
> look at this.  He’s been through more of these scenarios than I have.
>
>
>
> -Alex
>
>
>
> *From: *Nicolas Aguttes <ni...@gmail.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Sunday, May 17, 2020 at 10:24 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Re: Binding question/issue
>
>
>
> Hello Alex,
>
>
>
> this is the {MAX_CHARS_NOM} in my TextInput which is undefined and yes
> there is an error
>
>
>
>
>
> TypeError: this.dispatcher is undefinedSimpleBinding.js:228:3
>
>     set__strand
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/SimpleBinding.js
> :228
>
>     addBead
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js
> :120
>
>     addBead
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/HTMLElementWrapper.js
> :50
>
>     addBead
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
> :378
>
>     prepareCreatedBinding
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/DataBindingBase.js
> :79
>
>     initBindingsHandler
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/ViewDataBinding.js
> :82
>
>     <anonyme> self-hosted:844
>
>     fireListeners
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js
> :117
>
>     dispatchEventInternal_
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/library/closure/goog/events/eventtarget.js
> :382
>
>     dispatchEvent
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js
> :80
>
>     dispatchEvent
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js
> :243
>
>     addedToParent
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
> :70
>
>     addElement
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
> :405
>
>     addElement
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js
> :165
>
>     initializeStrandBasedObject
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
> :241
>
>     generateMXMLArray
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
> :127
>
>     generateMXMLInstances
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
> :271
>
>     addedToParent
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
> :69
>
>     addElement
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
> :405
>
>     addElement
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js
> :165
>
>     initializeStrandBasedObject
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
> :241
>
>     generateMXMLArray
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
> :127
>
>     generateMXMLInstances
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
> :271
>
>     addedToParent
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
> :69
>
>     addElement
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
> :144
>
>     initialize
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
> :295
>
>     start
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
> :264
>
>     <anonyme>
> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/TestBinding.html
> :155
>
>
>
> Le lun. 18 mai 2020 à 07:17, Alex Harui <ah...@adobe.com> a écrit :
>
> What value is undefined?  Is there a call stack or error message?
>
>
>
> -Alex
>
>
>
> *From: *Nicolas Aguttes <ni...@gmail.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Sunday, May 17, 2020 at 10:09 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Re: Binding question/issue
>
>
>
> Hello Alex,
>
> Thanks for your reply, I tried what you suggested and added addBead(new
> ContainerDataBinding()) to the constructor, I also tried to add to the
> Ecran1.mxml the
> <j:beads>
> <js:ContainerDataBinding/>
> </j:beads>
>
> And read the different example provided Carlos and tried to mimic them,but
> I still get an undefined
> value when I execute the application.
>
>
>
> Le dim. 17 mai 2020 à 08:19, Alex Harui <ah...@adobe.com> a écrit :
>
> Hi Nicolas,
>
>
>
> Looks like you are using the Jewel component set, so you may need to add
> ContainerDataBinding to the screens.  Different MXML files can have
> different binding implementation for performance reasons and there may not
> be one specified by default for PAYG reasons.
>
>
>
> You can do that by adding the ContainerDataBinding bead to the MXML files
> for screens where you have binding expressions in the same way you added
> ApplicationDataBinding to the main app, or if Ecran1Class is only used as
> the top tag in an MXML file, then it should be safe to just add the
> ContainerDataBinding bead in the Ecran1Class constructor.
>
>
>
> public function Ecran1Class()
> {
> super();
>
> addBead(new ContainerDataBinding());
> }
> }
>
>
>
> HTH,
>
> -Alex
>
>
>
> *From: *Nicolas Aguttes <ni...@gmail.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Saturday, May 16, 2020 at 10:31 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Binding question/issue
>
>
>
> Good morning all.
> I am new to Apache Royale and I don't know how to make binding work
> I have my main program which call some screens (ecrans.*)
> each screen has its applicationScript where I define some constant that I
> would link to bind to the view, it compiles, but the binding doesn't work
> and shows undefine value.
> I tried with differetn combination of
>  <j:beads>
>         <js:nnnnDataBinding/>
>     </j:beads>
> but without success.
>
> Can someone tell we what I am doing wrong?
> Thanks
> Nicolas
>
> Here is a non working extract of my code
> ----- Main ----
> <?xml version="1.0" encoding="utf-8"?>
> <j:Application
> xmlns:fx="http://ns.adobe.com/mxml/2009
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585784536&sdata=rY%2FtBqtESSzILnb8vKKQ7XohtewpADjueQVDMurKefY%3D&reserved=0>"
>
> xmlns:ecrans="ecrans.*"
> xmlns:j="library://ns.apache.org/royale/jewel
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585784536&sdata=G5FMdi9DDlnqJIgV6%2Bq79w1cTXvzb1EtRU61kP1i2L4%3D&reserved=0>
> "
> xmlns:js="library://ns.apache.org/royale/basic
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585794533&sdata=OxCg4iBHlCQpr78KUOJv4ZGY1RE0BX2X3JgBcAWevmA%3D&reserved=0>
> "
> xmlns:html="library://ns.apache.org/royale/html
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585794533&sdata=o8T1Cs9bk89ZAKbQW0wMgE0ZzhGvh%2FHRdAJzZNikA9A%3D&reserved=0>
> "
> width="100%"
> height="100%">
>    <j:beads>
>         <js:ApplicationDataBinding/>
>     </j:beads>
> <j:initialView>
>    <j:View id="vuePrincipale" width="100%" height="100%">
> <j:View id="EcranBox" width="100%" height="100%">
> <ecrans:Ecran1 id="Ecran1" />
>     </j:View>
>
> </j:View>
> </j:initialView>
> </j:Application>
>
> ----- Scren 1 .mxml  ------
> <?xml version="1.0" encoding="utf-8"?>
> <ecrans:Ecran1Class
> xmlns:fx="http://ns.adobe.com/mxml/2009
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585804525&sdata=AGNrZWgALrKCW%2BMInEGRivghDMQh4xDbCipQcP7qkTQ%3D&reserved=0>
> "
> xmlns:ecrans = "ecrans.*"
> xmlns:j="library://ns.apache.org/royale/jewel
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585804525&sdata=Dt8um9O7Ctjj2wrwRZZZ%2F%2B0R7M3Pb5BSJC3g6vwyyCg%3D&reserved=0>
> "
> xmlns:html="library://ns.apache.org/royale/html
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585814519&sdata=wUZ30EOa7ZhHO0K2qwK6O%2BW4FJPEA4fFxeu9Fk7mDRo%3D&reserved=0>
> "
> xmlns:js="library://ns.apache.org/royale/basic
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585814519&sdata=%2BOE5Et7Kh5M%2BMlIdEpo0DKVoE1uMEbwyPUDW2NaeTBo%3D&reserved=0>
> "
>     >
> <j:Form width="100%" height="100%" id="searchForm"  >
>
> <j:FormItem  id="labelNom"  label="nom :" width="100%" >
> <j:TextInput id="nom" >
> <j:beads>
> <j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
> </j:beads>
> </j:TextInput>
> </j:FormItem>
> </j:Form>
> </ecrans:Ecran1Class>
>
>
> ----- screen 1 .as  --------
> package ecrans
> {
> import org.apache.royale.jewel.View;
>
> public class Ecran1Class extends View
> {
> // Proprietes
> [Bindable] public static const MAX_CHARS_NOM:int = 50;
>
> // Constructeur
> public function Ecran1Class()
> {
> super();
> }
> }
>
>

Re: Binding question/issue

Posted by Alex Harui <ah...@adobe.com>.
Interesting.  I wonder if @Greg Dove<ma...@gmail.com> has time to look at this.  He’s been through more of these scenarios than I have.

-Alex

From: Nicolas Aguttes <ni...@gmail.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Sunday, May 17, 2020 at 10:24 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: Re: Binding question/issue

Hello Alex,

this is the {MAX_CHARS_NOM} in my TextInput which is undefined and yes there is an error


TypeError: this.dispatcher is undefinedSimpleBinding.js:228:3
    set__strand file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/SimpleBinding.js:228
    addBead file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js:120
    addBead file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/HTMLElementWrapper.js:50
    addBead file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js:378
    prepareCreatedBinding file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/DataBindingBase.js:79
    initBindingsHandler file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/ViewDataBinding.js:82
    <anonyme> self-hosted:844
    fireListeners file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js:117
    dispatchEventInternal_ file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/library/closure/goog/events/eventtarget.js:382
    dispatchEvent file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js:80
    dispatchEvent file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js:243
    addedToParent file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js:70
    addElement file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js:405
    addElement file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js:165
    initializeStrandBasedObject file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js:241
    generateMXMLArray file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js:127
    generateMXMLInstances file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js:271
    addedToParent file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js:69
    addElement file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js:405
    addElement file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js:165
    initializeStrandBasedObject file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js:241
    generateMXMLArray file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js:127
    generateMXMLInstances file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js:271
    addedToParent file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js:69
    addElement file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js:144
    initialize file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js:295
    start file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js:264
    <anonyme> file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/TestBinding.html:155

Le lun. 18 mai 2020 à 07:17, Alex Harui <ah...@adobe.com>> a écrit :
What value is undefined?  Is there a call stack or error message?

-Alex

From: Nicolas Aguttes <ni...@gmail.com>>
Reply-To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Date: Sunday, May 17, 2020 at 10:09 PM
To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Subject: Re: Binding question/issue

Hello Alex,

Thanks for your reply, I tried what you suggested and added addBead(new
ContainerDataBinding()) to the constructor, I also tried to add to the
Ecran1.mxml the
<j:beads>
<js:ContainerDataBinding/>
</j:beads>

And read the different example provided Carlos and tried to mimic them,but I still get an undefined
value when I execute the application.

Le dim. 17 mai 2020 à 08:19, Alex Harui <ah...@adobe.com>> a écrit :
Hi Nicolas,

Looks like you are using the Jewel component set, so you may need to add ContainerDataBinding to the screens.  Different MXML files can have different binding implementation for performance reasons and there may not be one specified by default for PAYG reasons.

You can do that by adding the ContainerDataBinding bead to the MXML files for screens where you have binding expressions in the same way you added ApplicationDataBinding to the main app, or if Ecran1Class is only used as the top tag in an MXML file, then it should be safe to just add the ContainerDataBinding bead in the Ecran1Class constructor.

public function Ecran1Class()
{
super();
addBead(new ContainerDataBinding());
}
}

HTH,
-Alex

From: Nicolas Aguttes <ni...@gmail.com>>
Reply-To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Date: Saturday, May 16, 2020 at 10:31 PM
To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Subject: Binding question/issue

Good morning all.
I am new to Apache Royale and I don't know how to make binding work
I have my main program which call some screens (ecrans.*)
each screen has its applicationScript where I define some constant that I would link to bind to the view, it compiles, but the binding doesn't work and shows undefine value.
I tried with differetn combination of
 <j:beads>
        <js:nnnnDataBinding/>
    </j:beads>
but without success.

Can someone tell we what I am doing wrong?
Thanks
Nicolas

Here is a non working extract of my code
----- Main ----
<?xml version="1.0" encoding="utf-8"?>
<j:Application
xmlns:fx="http://ns.adobe.com/mxml/2009<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585784536&sdata=rY%2FtBqtESSzILnb8vKKQ7XohtewpADjueQVDMurKefY%3D&reserved=0>"
xmlns:ecrans="ecrans.*"
xmlns:j="library://ns.apache.org/royale/jewel<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585784536&sdata=G5FMdi9DDlnqJIgV6%2Bq79w1cTXvzb1EtRU61kP1i2L4%3D&reserved=0>"
xmlns:js="library://ns.apache.org/royale/basic<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585794533&sdata=OxCg4iBHlCQpr78KUOJv4ZGY1RE0BX2X3JgBcAWevmA%3D&reserved=0>"
xmlns:html="library://ns.apache.org/royale/html<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585794533&sdata=o8T1Cs9bk89ZAKbQW0wMgE0ZzhGvh%2FHRdAJzZNikA9A%3D&reserved=0>"
width="100%"
height="100%">
   <j:beads>
        <js:ApplicationDataBinding/>
    </j:beads>
<j:initialView>
   <j:View id="vuePrincipale" width="100%" height="100%">
<j:View id="EcranBox" width="100%" height="100%">
<ecrans:Ecran1 id="Ecran1" />
    </j:View>

</j:View>
</j:initialView>
</j:Application>

----- Scren 1 .mxml  ------
<?xml version="1.0" encoding="utf-8"?>
<ecrans:Ecran1Class
xmlns:fx="http://ns.adobe.com/mxml/2009<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585804525&sdata=AGNrZWgALrKCW%2BMInEGRivghDMQh4xDbCipQcP7qkTQ%3D&reserved=0>"
xmlns:ecrans = "ecrans.*"
xmlns:j="library://ns.apache.org/royale/jewel<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585804525&sdata=Dt8um9O7Ctjj2wrwRZZZ%2F%2B0R7M3Pb5BSJC3g6vwyyCg%3D&reserved=0>"
xmlns:html="library://ns.apache.org/royale/html<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585814519&sdata=wUZ30EOa7ZhHO0K2qwK6O%2BW4FJPEA4fFxeu9Fk7mDRo%3D&reserved=0>"
xmlns:js="library://ns.apache.org/royale/basic<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7Cd8292b47cbce4e9a43dd08d7faebb4c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253762585814519&sdata=%2BOE5Et7Kh5M%2BMlIdEpo0DKVoE1uMEbwyPUDW2NaeTBo%3D&reserved=0>"
    >
<j:Form width="100%" height="100%" id="searchForm"  >

<j:FormItem  id="labelNom"  label="nom :" width="100%" >
<j:TextInput id="nom" >
<j:beads>
<j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
</j:beads>
</j:TextInput>
</j:FormItem>
</j:Form>
</ecrans:Ecran1Class>


----- screen 1 .as  --------
package ecrans
{
import org.apache.royale.jewel.View;

public class Ecran1Class extends View
{
// Proprietes
[Bindable] public static const MAX_CHARS_NOM:int = 50;

// Constructeur
public function Ecran1Class()
{
super();
}
}

Re: Binding question/issue

Posted by Nicolas Aguttes <ni...@gmail.com>.
Hello Alex,

this is the {MAX_CHARS_NOM} in my TextInput which is undefined and yes
there is an error


TypeError: this.dispatcher is undefinedSimpleBinding.js:228:3
    set__strand
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/SimpleBinding.js
:228
    addBead
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js
:120
    addBead
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/HTMLElementWrapper.js
:50
    addBead
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
:378
    prepareCreatedBinding
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/DataBindingBase.js
:79
    initBindingsHandler
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/binding/ViewDataBinding.js
:82
    <anonyme> self-hosted:844
    fireListeners
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js
:117
    dispatchEventInternal_
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/library/closure/goog/events/eventtarget.js
:382
    dispatchEvent
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/events/EventDispatcher.js
:80
    dispatchEvent
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/ElementWrapper.js
:243
    addedToParent
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
:70
    addElement
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
:405
    addElement
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js
:165
    initializeStrandBasedObject
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
:241
    generateMXMLArray
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
:127
    generateMXMLInstances
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
:271
    addedToParent
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
:69
    addElement
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/UIBase.js
:405
    addElement
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/core/GroupBase.js
:165
    initializeStrandBasedObject
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
:241
    generateMXMLArray
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
:127
    generateMXMLInstances
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/utils/MXMLDataInterpreter.js
:271
    addedToParent
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/View.js
:69
    addElement
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
:144
    initialize
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
:295
    start
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/org/apache/royale/jewel/Application.js
:264
    <anonyme>
file:///Users/nicolasA/Documents/dev/ApacheRoyale/TestBinding/bin/js-debug/TestBinding.html
:155

Le lun. 18 mai 2020 à 07:17, Alex Harui <ah...@adobe.com> a écrit :

> What value is undefined?  Is there a call stack or error message?
>
>
>
> -Alex
>
>
>
> *From: *Nicolas Aguttes <ni...@gmail.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Sunday, May 17, 2020 at 10:09 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Re: Binding question/issue
>
>
>
> Hello Alex,
>
> Thanks for your reply, I tried what you suggested and added addBead(new
> ContainerDataBinding()) to the constructor, I also tried to add to the
> Ecran1.mxml the
> <j:beads>
> <js:ContainerDataBinding/>
> </j:beads>
>
> And read the different example provided Carlos and tried to mimic them,but
> I still get an undefined
> value when I execute the application.
>
>
>
> Le dim. 17 mai 2020 à 08:19, Alex Harui <ah...@adobe.com> a écrit :
>
> Hi Nicolas,
>
>
>
> Looks like you are using the Jewel component set, so you may need to add
> ContainerDataBinding to the screens.  Different MXML files can have
> different binding implementation for performance reasons and there may not
> be one specified by default for PAYG reasons.
>
>
>
> You can do that by adding the ContainerDataBinding bead to the MXML files
> for screens where you have binding expressions in the same way you added
> ApplicationDataBinding to the main app, or if Ecran1Class is only used as
> the top tag in an MXML file, then it should be safe to just add the
> ContainerDataBinding bead in the Ecran1Class constructor.
>
>
>
> public function Ecran1Class()
> {
> super();
>
> addBead(new ContainerDataBinding());
> }
> }
>
>
>
> HTH,
>
> -Alex
>
>
>
> *From: *Nicolas Aguttes <ni...@gmail.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Saturday, May 16, 2020 at 10:31 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Binding question/issue
>
>
>
> Good morning all.
> I am new to Apache Royale and I don't know how to make binding work
> I have my main program which call some screens (ecrans.*)
> each screen has its applicationScript where I define some constant that I
> would link to bind to the view, it compiles, but the binding doesn't work
> and shows undefine value.
> I tried with differetn combination of
>  <j:beads>
>         <js:nnnnDataBinding/>
>     </j:beads>
> but without success.
>
> Can someone tell we what I am doing wrong?
> Thanks
> Nicolas
>
> Here is a non working extract of my code
> ----- Main ----
> <?xml version="1.0" encoding="utf-8"?>
> <j:Application
> xmlns:fx="http://ns.adobe.com/mxml/2009
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915541661&sdata=tfcXjw6xKq0wD1ZYCH9ZhARdj5R0MuMtqamW8gB8FmE%3D&reserved=0>"
>
> xmlns:ecrans="ecrans.*"
> xmlns:j="library://ns.apache.org/royale/jewel
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915546652&sdata=V%2Bcaft%2FU2YCYs1AS0xPlarDjo2IezuZK8HpsozkpocI%3D&reserved=0>
> "
> xmlns:js="library://ns.apache.org/royale/basic
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915551639&sdata=B7QjVUtCQU5ujMYywbC7mftwMYd1ESJcN%2FkhI1V2Wx8%3D&reserved=0>
> "
> xmlns:html="library://ns.apache.org/royale/html
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915556631&sdata=kQOePunBQioTXAOt82eS0WPcZc0%2B03PEVvjv57%2FI8mg%3D&reserved=0>
> "
> width="100%"
> height="100%">
>    <j:beads>
>         <js:ApplicationDataBinding/>
>     </j:beads>
> <j:initialView>
>    <j:View id="vuePrincipale" width="100%" height="100%">
> <j:View id="EcranBox" width="100%" height="100%">
> <ecrans:Ecran1 id="Ecran1" />
>     </j:View>
>
> </j:View>
> </j:initialView>
> </j:Application>
>
> ----- Scren 1 .mxml  ------
> <?xml version="1.0" encoding="utf-8"?>
> <ecrans:Ecran1Class
> xmlns:fx="http://ns.adobe.com/mxml/2009
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915561622&sdata=EbqCQaeSvYeBnRv8ReIrXNGjkROBzOd%2BpfRMo6Zdk9w%3D&reserved=0>
> "
> xmlns:ecrans = "ecrans.*"
> xmlns:j="library://ns.apache.org/royale/jewel
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915566613&sdata=W5IAF2ELBv01Snp%2BpNzmeljjPgnoBW%2Fbxrtw2%2F5iPIo%3D&reserved=0>
> "
> xmlns:html="library://ns.apache.org/royale/html
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915571604&sdata=Y4MSUUSNe7ERh9FnsEhGrfMZ4Xj%2F8YDjT82sR1W53xo%3D&reserved=0>
> "
> xmlns:js="library://ns.apache.org/royale/basic
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915576595&sdata=%2BXCkXzIbLT97VqKsBQaKwqJDq8n8wx2LKnPUoXw49EE%3D&reserved=0>
> "
>     >
> <j:Form width="100%" height="100%" id="searchForm"  >
>
> <j:FormItem  id="labelNom"  label="nom :" width="100%" >
> <j:TextInput id="nom" >
> <j:beads>
> <j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
> </j:beads>
> </j:TextInput>
> </j:FormItem>
> </j:Form>
> </ecrans:Ecran1Class>
>
>
> ----- screen 1 .as  --------
> package ecrans
> {
> import org.apache.royale.jewel.View;
>
> public class Ecran1Class extends View
> {
> // Proprietes
> [Bindable] public static const MAX_CHARS_NOM:int = 50;
>
> // Constructeur
> public function Ecran1Class()
> {
> super();
> }
> }
>
>

Re: Binding question/issue

Posted by Alex Harui <ah...@adobe.com>.
What value is undefined?  Is there a call stack or error message?

-Alex

From: Nicolas Aguttes <ni...@gmail.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Sunday, May 17, 2020 at 10:09 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: Re: Binding question/issue

Hello Alex,

Thanks for your reply, I tried what you suggested and added addBead(new
ContainerDataBinding()) to the constructor, I also tried to add to the
Ecran1.mxml the
<j:beads>
<js:ContainerDataBinding/>
</j:beads>

And read the different example provided Carlos and tried to mimic them,but I still get an undefined
value when I execute the application.

Le dim. 17 mai 2020 à 08:19, Alex Harui <ah...@adobe.com>> a écrit :
Hi Nicolas,

Looks like you are using the Jewel component set, so you may need to add ContainerDataBinding to the screens.  Different MXML files can have different binding implementation for performance reasons and there may not be one specified by default for PAYG reasons.

You can do that by adding the ContainerDataBinding bead to the MXML files for screens where you have binding expressions in the same way you added ApplicationDataBinding to the main app, or if Ecran1Class is only used as the top tag in an MXML file, then it should be safe to just add the ContainerDataBinding bead in the Ecran1Class constructor.

public function Ecran1Class()
{
super();
addBead(new ContainerDataBinding());
}
}

HTH,
-Alex

From: Nicolas Aguttes <ni...@gmail.com>>
Reply-To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Date: Saturday, May 16, 2020 at 10:31 PM
To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Subject: Binding question/issue

Good morning all.
I am new to Apache Royale and I don't know how to make binding work
I have my main program which call some screens (ecrans.*)
each screen has its applicationScript where I define some constant that I would link to bind to the view, it compiles, but the binding doesn't work and shows undefine value.
I tried with differetn combination of
 <j:beads>
        <js:nnnnDataBinding/>
    </j:beads>
but without success.

Can someone tell we what I am doing wrong?
Thanks
Nicolas

Here is a non working extract of my code
----- Main ----
<?xml version="1.0" encoding="utf-8"?>
<j:Application
xmlns:fx="http://ns.adobe.com/mxml/2009<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915541661&sdata=tfcXjw6xKq0wD1ZYCH9ZhARdj5R0MuMtqamW8gB8FmE%3D&reserved=0>"
xmlns:ecrans="ecrans.*"
xmlns:j="library://ns.apache.org/royale/jewel<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915546652&sdata=V%2Bcaft%2FU2YCYs1AS0xPlarDjo2IezuZK8HpsozkpocI%3D&reserved=0>"
xmlns:js="library://ns.apache.org/royale/basic<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915551639&sdata=B7QjVUtCQU5ujMYywbC7mftwMYd1ESJcN%2FkhI1V2Wx8%3D&reserved=0>"
xmlns:html="library://ns.apache.org/royale/html<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915556631&sdata=kQOePunBQioTXAOt82eS0WPcZc0%2B03PEVvjv57%2FI8mg%3D&reserved=0>"
width="100%"
height="100%">
   <j:beads>
        <js:ApplicationDataBinding/>
    </j:beads>
<j:initialView>
   <j:View id="vuePrincipale" width="100%" height="100%">
<j:View id="EcranBox" width="100%" height="100%">
<ecrans:Ecran1 id="Ecran1" />
    </j:View>

</j:View>
</j:initialView>
</j:Application>

----- Scren 1 .mxml  ------
<?xml version="1.0" encoding="utf-8"?>
<ecrans:Ecran1Class
xmlns:fx="http://ns.adobe.com/mxml/2009<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915561622&sdata=EbqCQaeSvYeBnRv8ReIrXNGjkROBzOd%2BpfRMo6Zdk9w%3D&reserved=0>"
xmlns:ecrans = "ecrans.*"
xmlns:j="library://ns.apache.org/royale/jewel<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915566613&sdata=W5IAF2ELBv01Snp%2BpNzmeljjPgnoBW%2Fbxrtw2%2F5iPIo%3D&reserved=0>"
xmlns:html="library://ns.apache.org/royale/html<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915571604&sdata=Y4MSUUSNe7ERh9FnsEhGrfMZ4Xj%2F8YDjT82sR1W53xo%3D&reserved=0>"
xmlns:js="library://ns.apache.org/royale/basic<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C8e8abc114a8d43681f6a08d7fae9afd9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637253753915576595&sdata=%2BXCkXzIbLT97VqKsBQaKwqJDq8n8wx2LKnPUoXw49EE%3D&reserved=0>"
    >
<j:Form width="100%" height="100%" id="searchForm"  >

<j:FormItem  id="labelNom"  label="nom :" width="100%" >
<j:TextInput id="nom" >
<j:beads>
<j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
</j:beads>
</j:TextInput>
</j:FormItem>
</j:Form>
</ecrans:Ecran1Class>


----- screen 1 .as  --------
package ecrans
{
import org.apache.royale.jewel.View;

public class Ecran1Class extends View
{
// Proprietes
[Bindable] public static const MAX_CHARS_NOM:int = 50;

// Constructeur
public function Ecran1Class()
{
super();
}
}

Re: Binding question/issue

Posted by Nicolas Aguttes <ni...@gmail.com>.
Hello Alex,

Thanks for your reply, I tried what you suggested and added addBead(new
ContainerDataBinding()) to the constructor, I also tried to add to the
Ecran1.mxml the
<j:beads>
<js:ContainerDataBinding/>
</j:beads>

And read the different example provided Carlos and tried to mimic them,but
I still get an undefined
value when I execute the application.

Le dim. 17 mai 2020 à 08:19, Alex Harui <ah...@adobe.com> a écrit :

> Hi Nicolas,
>
>
>
> Looks like you are using the Jewel component set, so you may need to add
> ContainerDataBinding to the screens.  Different MXML files can have
> different binding implementation for performance reasons and there may not
> be one specified by default for PAYG reasons.
>
>
>
> You can do that by adding the ContainerDataBinding bead to the MXML files
> for screens where you have binding expressions in the same way you added
> ApplicationDataBinding to the main app, or if Ecran1Class is only used as
> the top tag in an MXML file, then it should be safe to just add the
> ContainerDataBinding bead in the Ecran1Class constructor.
>
>
>
> public function Ecran1Class()
> {
> super();
>
> addBead(new ContainerDataBinding());
> }
> }
>
>
>
> HTH,
>
> -Alex
>
>
>
> *From: *Nicolas Aguttes <ni...@gmail.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Saturday, May 16, 2020 at 10:31 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Binding question/issue
>
>
>
> Good morning all.
> I am new to Apache Royale and I don't know how to make binding work
> I have my main program which call some screens (ecrans.*)
> each screen has its applicationScript where I define some constant that I
> would link to bind to the view, it compiles, but the binding doesn't work
> and shows undefine value.
> I tried with differetn combination of
>  <j:beads>
>         <js:nnnnDataBinding/>
>     </j:beads>
> but without success.
>
> Can someone tell we what I am doing wrong?
> Thanks
> Nicolas
>
> Here is a non working extract of my code
> ----- Main ----
> <?xml version="1.0" encoding="utf-8"?>
> <j:Application
> xmlns:fx="http://ns.adobe.com/mxml/2009
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135709487&sdata=TAvlz%2B5UpoRVz6m2rbXYGn2Ot7ViiLw3mivUEFSY6%2Bw%3D&reserved=0>"
>
> xmlns:ecrans="ecrans.*"
> xmlns:j="library://ns.apache.org/royale/jewel
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135719481&sdata=Iyyi8hzJn2LqT4%2BkKv8S7zq8He3oPlvPUxR8ea4EVl8%3D&reserved=0>
> "
> xmlns:js="library://ns.apache.org/royale/basic
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135729485&sdata=7VkHK6SZcEHB1RfYzOJo4ilwtnxavElTbTKnwnr5kqI%3D&reserved=0>
> "
> xmlns:html="library://ns.apache.org/royale/html
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135729485&sdata=koPs87mBTCNVh0O8JCSt4M4XdxkyCXJX7VoDsQAAPTY%3D&reserved=0>
> "
> width="100%"
> height="100%">
>    <j:beads>
>         <js:ApplicationDataBinding/>
>     </j:beads>
> <j:initialView>
>    <j:View id="vuePrincipale" width="100%" height="100%">
> <j:View id="EcranBox" width="100%" height="100%">
> <ecrans:Ecran1 id="Ecran1" />
>     </j:View>
>
> </j:View>
> </j:initialView>
> </j:Application>
>
> ----- Scren 1 .mxml  ------
> <?xml version="1.0" encoding="utf-8"?>
> <ecrans:Ecran1Class
> xmlns:fx="http://ns.adobe.com/mxml/2009
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135739478&sdata=gpcSKYpvjAgJ3QSd50eZw8oNmVdOi5B5g44vYMzKFxs%3D&reserved=0>
> "
> xmlns:ecrans = "ecrans.*"
> xmlns:j="library://ns.apache.org/royale/jewel
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135739478&sdata=V8xnJIhiW%2Fos0EAO8E3tvDwBHhRG3IUEjpB3VJMroeM%3D&reserved=0>
> "
> xmlns:html="library://ns.apache.org/royale/html
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135749470&sdata=BbRImRMkckHlvS5Z1V5nhx0VFqF%2FnpoAw6LNRJzZm%2BQ%3D&reserved=0>
> "
> xmlns:js="library://ns.apache.org/royale/basic
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135749470&sdata=aj%2BOjRT9lnJRikrF3zlwxE3VtTIaUu0nBXIufeqV2mY%3D&reserved=0>
> "
>     >
> <j:Form width="100%" height="100%" id="searchForm"  >
>
> <j:FormItem  id="labelNom"  label="nom :" width="100%" >
> <j:TextInput id="nom" >
> <j:beads>
> <j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
> </j:beads>
> </j:TextInput>
> </j:FormItem>
> </j:Form>
> </ecrans:Ecran1Class>
>
>
> ----- screen 1 .as  --------
> package ecrans
> {
> import org.apache.royale.jewel.View;
>
> public class Ecran1Class extends View
> {
> // Proprietes
> [Bindable] public static const MAX_CHARS_NOM:int = 50;
>
> // Constructeur
> public function Ecran1Class()
> {
> super();
> }
> }
>

Re: Binding question/issue

Posted by Alex Harui <ah...@adobe.com>.
Hi Nicolas,

Looks like you are using the Jewel component set, so you may need to add ContainerDataBinding to the screens.  Different MXML files can have different binding implementation for performance reasons and there may not be one specified by default for PAYG reasons.

You can do that by adding the ContainerDataBinding bead to the MXML files for screens where you have binding expressions in the same way you added ApplicationDataBinding to the main app, or if Ecran1Class is only used as the top tag in an MXML file, then it should be safe to just add the ContainerDataBinding bead in the Ecran1Class constructor.

public function Ecran1Class()
{
super();
addBead(new ContainerDataBinding());
}
}

HTH,
-Alex

From: Nicolas Aguttes <ni...@gmail.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Saturday, May 16, 2020 at 10:31 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: Binding question/issue

Good morning all.
I am new to Apache Royale and I don't know how to make binding work
I have my main program which call some screens (ecrans.*)
each screen has its applicationScript where I define some constant that I would link to bind to the view, it compiles, but the binding doesn't work and shows undefine value.
I tried with differetn combination of
 <j:beads>
        <js:nnnnDataBinding/>
    </j:beads>
but without success.

Can someone tell we what I am doing wrong?
Thanks
Nicolas

Here is a non working extract of my code
----- Main ----
<?xml version="1.0" encoding="utf-8"?>
<j:Application
xmlns:fx="http://ns.adobe.com/mxml/2009<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135709487&sdata=TAvlz%2B5UpoRVz6m2rbXYGn2Ot7ViiLw3mivUEFSY6%2Bw%3D&reserved=0>"
xmlns:ecrans="ecrans.*"
xmlns:j="library://ns.apache.org/royale/jewel<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135719481&sdata=Iyyi8hzJn2LqT4%2BkKv8S7zq8He3oPlvPUxR8ea4EVl8%3D&reserved=0>"
xmlns:js="library://ns.apache.org/royale/basic<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135729485&sdata=7VkHK6SZcEHB1RfYzOJo4ilwtnxavElTbTKnwnr5kqI%3D&reserved=0>"
xmlns:html="library://ns.apache.org/royale/html<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135729485&sdata=koPs87mBTCNVh0O8JCSt4M4XdxkyCXJX7VoDsQAAPTY%3D&reserved=0>"
width="100%"
height="100%">
   <j:beads>
        <js:ApplicationDataBinding/>
    </j:beads>
<j:initialView>
   <j:View id="vuePrincipale" width="100%" height="100%">
<j:View id="EcranBox" width="100%" height="100%">
<ecrans:Ecran1 id="Ecran1" />
    </j:View>

</j:View>
</j:initialView>
</j:Application>

----- Scren 1 .mxml  ------
<?xml version="1.0" encoding="utf-8"?>
<ecrans:Ecran1Class
xmlns:fx="http://ns.adobe.com/mxml/2009<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135739478&sdata=gpcSKYpvjAgJ3QSd50eZw8oNmVdOi5B5g44vYMzKFxs%3D&reserved=0>"
xmlns:ecrans = "ecrans.*"
xmlns:j="library://ns.apache.org/royale/jewel<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fjewel&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135739478&sdata=V8xnJIhiW%2Fos0EAO8E3tvDwBHhRG3IUEjpB3VJMroeM%3D&reserved=0>"
xmlns:html="library://ns.apache.org/royale/html<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fhtml&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135749470&sdata=BbRImRMkckHlvS5Z1V5nhx0VFqF%2FnpoAw6LNRJzZm%2BQ%3D&reserved=0>"
xmlns:js="library://ns.apache.org/royale/basic<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fbasic&data=02%7C01%7Caharui%40adobe.com%7C795b58ddc11c4fc011a908d7fa239a78%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637252903135749470&sdata=aj%2BOjRT9lnJRikrF3zlwxE3VtTIaUu0nBXIufeqV2mY%3D&reserved=0>"
    >
<j:Form width="100%" height="100%" id="searchForm"  >

<j:FormItem  id="labelNom"  label="nom :" width="100%" >
<j:TextInput id="nom" >
<j:beads>
<j:MaxNumberCharacters maxlength="{MAX_CHARS_NOM}" />
</j:beads>
</j:TextInput>
</j:FormItem>
</j:Form>
</ecrans:Ecran1Class>


----- screen 1 .as  --------
package ecrans
{
import org.apache.royale.jewel.View;

public class Ecran1Class extends View
{
// Proprietes
[Bindable] public static const MAX_CHARS_NOM:int = 50;

// Constructeur
public function Ecran1Class()
{
super();
}
}