You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Hugo Ferreira <hf...@gmail.com> on 2020/07/09 22:02:09 UTC

BindingUtils.bindProperty - Issue or I'm doing something wrong ?

The following line of code, compiles without any issue:
BindingUtils.bindProperty(header, "minimized", content, ["visible"]);

However at runtime, I got the following error on Google Chrome Console:
Uncaught TypeError: Error #1034: Type Coercion failed: cannot convert
visible to org.apache.royale.crux.binding.BindableChainInfo
    at Function.org.apache.royale.utils.Language.as (Language.js:115)
    at Function.org.apache.royale.crux.binding.BindingUtils.bindProperty
(BindingUtils.js:73)
    at
pt.solidsoft.gc.view.login.Login.pt.solidsoft.framework.form.Form.addElement
(Form.mxml:32)
    at
Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
(MXMLDataInterpreter.js:241)
    at
Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLArray
(MXMLDataInterpreter.js:127)
    at
Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLInstances
(MXMLDataInterpreter.js:271)
    at
pt.solidsoft.gc.view.login.Login.org.apache.royale.jewel.Container.addedToParent
(Container.js:76)
    at
org.apache.royale.html.Group.org.apache.royale.core.UIBase.addElement
(UIBase.js:405)
    at
org.apache.royale.html.Group.org.apache.royale.core.GroupBase.addElement
(GroupBase.js:165)
    at
Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
(MXMLDataInterpreter.js:241)

An explanation:
header is the source instance of a component
minimized is the public Bindable property that I'm listening
content is the target instance of a component
visible is the visibility of the target that I want to depend on the
minimized property

Is this a bug that I should insert on github issues or I'm doing something
wrong ?

Re: BindingUtils.bindProperty - Issue or I'm doing something wrong ?

Posted by Hugo Ferreira <hf...@gmail.com>.
Even BindingUtils didn't show off, RemoteObject from mx seems to be there.
The second option is enough.

"We hopefully will separate MX in libraries and will create a "jewel" config
that adds RPC and maybe others that could be needed."
That would be great.

Carlos Rovira <ca...@apache.org> escreveu no dia sexta, 10/07/2020
à(s) 11:20:

> I'm not an expert on asconfic, but I remember I solved it maintaining
> "royale" as config and adding this:
>
> "library-path": [
> "${royalelib}/js/libs/MXRoyaleJS.swc"
> ],
> "js-library-path": [
> "${royalelib}/js/libs/MXRoyaleJS.swc"
> ],
>
> I think maybe just the second was enough...
>
> We hopefully will separate MX in libraries and will create a "jewel" config
> that adds RPC and maybe others that could be needed.
>
> Also remember to remove mx css adding this to additional compiler options:
>
>
> -compiler.exclude-defaults-css-files=MXRoyale-${royale.framework.version}-js.swc:defaults.css;
>
>
>
> El vie., 10 jul. 2020 a las 11:23, Hugo Ferreira (<hferreira.80@gmail.com
> >)
> escribió:
>
> > Hello,
> >
> > That's a good idea, because I want to avoid MX UI as much as possible,
> > since I decided for Royale, so Royale it is.
> > However I don't see so many problems for non-UI stuff.
> > My issue is that to work with MX, I saw that I need to change my
> > asconfig.json from "config": "royale" to "config": "flex" (ps: I'm using
> > Visual Studio Code) and then I got all sort of namespace conflicts
> between
> > MX and Royale.For what you said, I believe that's a better way to mix MX
> > and Royale without changing so dramatically config file.
> >
> > Carlos Rovira <ca...@apache.org> escreveu no dia sexta,
> 10/07/2020
> > à(s) 09:32:
> >
> > > Hi Hugo,
> > > you can use MXRoyale in "Royale only" (i.e: jewel) apps.
> > > You must to be careful, but code like RPC classes, validators, and
> > probably
> > > BindingUtils can be used.
> > > I think while you don't use "visual" things, that should be ok. It
> maybe
> > > would require you to try it, but at least RPC classes are working for
> > many
> > > others and I used as well some validators time ago.
> > >
> > > El vie., 10 jul. 2020 a las 0:39, Hugo Ferreira (<
> hferreira.80@gmail.com
> > >)
> > > escribió:
> > >
> > > > OK.
> > > > I'm using Royale only, so BindingUtils (mx version) is not available
> in
> > > my
> > > > case.
> > > > I will try to workaround in a different way (for sure I have to write
> > > more
> > > > code) but yes, BindingUtils is a short way in a single line to do the
> > > > things (it will be a missing feature).
> > > >
> > > > Greg Dove <gr...@gmail.com> escreveu no dia quinta, 9/07/2020
> à(s)
> > > > 23:34:
> > > >
> > > > > When I originally wrote that, it was not intended to be used
> directly
> > > in
> > > > > code, it was intended to support the metadata-driven injected
> > bindings,
> > > > > specifically with Crux. It is quite specific for Crux.
> > > > > It does need BindableChainInfo instances in that last argument
> > instead
> > > of
> > > > > strings. Perhaps the code can be adapted to be more useful other
> than
> > > > with
> > > > > Crux, but would need some time and effort focused on that.
> > > > > Is it not viable to use injection in your case?
> > > > >
> > > > > Since I worked on that, I did also do some work in the mx.binding
> > > inside
> > > > > MXRoyale. Maybe the BindingUtils in there is more like what you
> want?
> > > (It
> > > > > is closer to the original Flex)
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On Fri, Jul 10, 2020 at 10:02 AM Hugo Ferreira <
> > hferreira.80@gmail.com
> > > >
> > > > > wrote:
> > > > >
> > > > > > The following line of code, compiles without any issue:
> > > > > > BindingUtils.bindProperty(header, "minimized", content,
> > ["visible"]);
> > > > > >
> > > > > > However at runtime, I got the following error on Google Chrome
> > > Console:
> > > > > > Uncaught TypeError: Error #1034: Type Coercion failed: cannot
> > convert
> > > > > > visible to org.apache.royale.crux.binding.BindableChainInfo
> > > > > >     at Function.org.apache.royale.utils.Language.as
> > > (Language.js:115)
> > > > > >     at
> > > > Function.org.apache.royale.crux.binding.BindingUtils.bindProperty
> > > > > > (BindingUtils.js:73)
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> pt.solidsoft.gc.view.login.Login.pt.solidsoft.framework.form.Form.addElement
> > > > > > (Form.mxml:32)
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
> > > > > > (MXMLDataInterpreter.js:241)
> > > > > >     at
> > > > > >
> > > Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLArray
> > > > > > (MXMLDataInterpreter.js:127)
> > > > > >     at
> > > > > >
> > > > >
> > > >
> > >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLInstances
> > > > > > (MXMLDataInterpreter.js:271)
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> pt.solidsoft.gc.view.login.Login.org.apache.royale.jewel.Container.addedToParent
> > > > > > (Container.js:76)
> > > > > >     at
> > > > > >
> > org.apache.royale.html.Group.org.apache.royale.core.UIBase.addElement
> > > > > > (UIBase.js:405)
> > > > > >     at
> > > > > >
> > > >
> > org.apache.royale.html.Group.org.apache.royale.core.GroupBase.addElement
> > > > > > (GroupBase.js:165)
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
> > > > > > (MXMLDataInterpreter.js:241)
> > > > > >
> > > > > > An explanation:
> > > > > > header is the source instance of a component
> > > > > > minimized is the public Bindable property that I'm listening
> > > > > > content is the target instance of a component
> > > > > > visible is the visibility of the target that I want to depend on
> > the
> > > > > > minimized property
> > > > > >
> > > > > > Is this a bug that I should insert on github issues or I'm doing
> > > > > something
> > > > > > wrong ?
> > > > > >
> > > > >
> > > >
> > >
> > >
> > > --
> > > Carlos Rovira
> > > http://about.me/carlosrovira
> > >
> >
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>

Re: BindingUtils.bindProperty - Issue or I'm doing something wrong ?

Posted by Carlos Rovira <ca...@apache.org>.
I'm not an expert on asconfic, but I remember I solved it maintaining
"royale" as config and adding this:

"library-path": [
"${royalelib}/js/libs/MXRoyaleJS.swc"
],
"js-library-path": [
"${royalelib}/js/libs/MXRoyaleJS.swc"
],

I think maybe just the second was enough...

We hopefully will separate MX in libraries and will create a "jewel" config
that adds RPC and maybe others that could be needed.

Also remember to remove mx css adding this to additional compiler options:

-compiler.exclude-defaults-css-files=MXRoyale-${royale.framework.version}-js.swc:defaults.css;



El vie., 10 jul. 2020 a las 11:23, Hugo Ferreira (<hf...@gmail.com>)
escribió:

> Hello,
>
> That's a good idea, because I want to avoid MX UI as much as possible,
> since I decided for Royale, so Royale it is.
> However I don't see so many problems for non-UI stuff.
> My issue is that to work with MX, I saw that I need to change my
> asconfig.json from "config": "royale" to "config": "flex" (ps: I'm using
> Visual Studio Code) and then I got all sort of namespace conflicts between
> MX and Royale.For what you said, I believe that's a better way to mix MX
> and Royale without changing so dramatically config file.
>
> Carlos Rovira <ca...@apache.org> escreveu no dia sexta, 10/07/2020
> à(s) 09:32:
>
> > Hi Hugo,
> > you can use MXRoyale in "Royale only" (i.e: jewel) apps.
> > You must to be careful, but code like RPC classes, validators, and
> probably
> > BindingUtils can be used.
> > I think while you don't use "visual" things, that should be ok. It maybe
> > would require you to try it, but at least RPC classes are working for
> many
> > others and I used as well some validators time ago.
> >
> > El vie., 10 jul. 2020 a las 0:39, Hugo Ferreira (<hferreira.80@gmail.com
> >)
> > escribió:
> >
> > > OK.
> > > I'm using Royale only, so BindingUtils (mx version) is not available in
> > my
> > > case.
> > > I will try to workaround in a different way (for sure I have to write
> > more
> > > code) but yes, BindingUtils is a short way in a single line to do the
> > > things (it will be a missing feature).
> > >
> > > Greg Dove <gr...@gmail.com> escreveu no dia quinta, 9/07/2020 à(s)
> > > 23:34:
> > >
> > > > When I originally wrote that, it was not intended to be used directly
> > in
> > > > code, it was intended to support the metadata-driven injected
> bindings,
> > > > specifically with Crux. It is quite specific for Crux.
> > > > It does need BindableChainInfo instances in that last argument
> instead
> > of
> > > > strings. Perhaps the code can be adapted to be more useful other than
> > > with
> > > > Crux, but would need some time and effort focused on that.
> > > > Is it not viable to use injection in your case?
> > > >
> > > > Since I worked on that, I did also do some work in the mx.binding
> > inside
> > > > MXRoyale. Maybe the BindingUtils in there is more like what you want?
> > (It
> > > > is closer to the original Flex)
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On Fri, Jul 10, 2020 at 10:02 AM Hugo Ferreira <
> hferreira.80@gmail.com
> > >
> > > > wrote:
> > > >
> > > > > The following line of code, compiles without any issue:
> > > > > BindingUtils.bindProperty(header, "minimized", content,
> ["visible"]);
> > > > >
> > > > > However at runtime, I got the following error on Google Chrome
> > Console:
> > > > > Uncaught TypeError: Error #1034: Type Coercion failed: cannot
> convert
> > > > > visible to org.apache.royale.crux.binding.BindableChainInfo
> > > > >     at Function.org.apache.royale.utils.Language.as
> > (Language.js:115)
> > > > >     at
> > > Function.org.apache.royale.crux.binding.BindingUtils.bindProperty
> > > > > (BindingUtils.js:73)
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> pt.solidsoft.gc.view.login.Login.pt.solidsoft.framework.form.Form.addElement
> > > > > (Form.mxml:32)
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
> > > > > (MXMLDataInterpreter.js:241)
> > > > >     at
> > > > >
> > Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLArray
> > > > > (MXMLDataInterpreter.js:127)
> > > > >     at
> > > > >
> > > >
> > >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLInstances
> > > > > (MXMLDataInterpreter.js:271)
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> pt.solidsoft.gc.view.login.Login.org.apache.royale.jewel.Container.addedToParent
> > > > > (Container.js:76)
> > > > >     at
> > > > >
> org.apache.royale.html.Group.org.apache.royale.core.UIBase.addElement
> > > > > (UIBase.js:405)
> > > > >     at
> > > > >
> > >
> org.apache.royale.html.Group.org.apache.royale.core.GroupBase.addElement
> > > > > (GroupBase.js:165)
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
> > > > > (MXMLDataInterpreter.js:241)
> > > > >
> > > > > An explanation:
> > > > > header is the source instance of a component
> > > > > minimized is the public Bindable property that I'm listening
> > > > > content is the target instance of a component
> > > > > visible is the visibility of the target that I want to depend on
> the
> > > > > minimized property
> > > > >
> > > > > Is this a bug that I should insert on github issues or I'm doing
> > > > something
> > > > > wrong ?
> > > > >
> > > >
> > >
> >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>


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

Re: BindingUtils.bindProperty - Issue or I'm doing something wrong ?

Posted by Hugo Ferreira <hf...@gmail.com>.
Hello,

That's a good idea, because I want to avoid MX UI as much as possible,
since I decided for Royale, so Royale it is.
However I don't see so many problems for non-UI stuff.
My issue is that to work with MX, I saw that I need to change my
asconfig.json from "config": "royale" to "config": "flex" (ps: I'm using
Visual Studio Code) and then I got all sort of namespace conflicts between
MX and Royale.For what you said, I believe that's a better way to mix MX
and Royale without changing so dramatically config file.

Carlos Rovira <ca...@apache.org> escreveu no dia sexta, 10/07/2020
à(s) 09:32:

> Hi Hugo,
> you can use MXRoyale in "Royale only" (i.e: jewel) apps.
> You must to be careful, but code like RPC classes, validators, and probably
> BindingUtils can be used.
> I think while you don't use "visual" things, that should be ok. It maybe
> would require you to try it, but at least RPC classes are working for many
> others and I used as well some validators time ago.
>
> El vie., 10 jul. 2020 a las 0:39, Hugo Ferreira (<hf...@gmail.com>)
> escribió:
>
> > OK.
> > I'm using Royale only, so BindingUtils (mx version) is not available in
> my
> > case.
> > I will try to workaround in a different way (for sure I have to write
> more
> > code) but yes, BindingUtils is a short way in a single line to do the
> > things (it will be a missing feature).
> >
> > Greg Dove <gr...@gmail.com> escreveu no dia quinta, 9/07/2020 à(s)
> > 23:34:
> >
> > > When I originally wrote that, it was not intended to be used directly
> in
> > > code, it was intended to support the metadata-driven injected bindings,
> > > specifically with Crux. It is quite specific for Crux.
> > > It does need BindableChainInfo instances in that last argument instead
> of
> > > strings. Perhaps the code can be adapted to be more useful other than
> > with
> > > Crux, but would need some time and effort focused on that.
> > > Is it not viable to use injection in your case?
> > >
> > > Since I worked on that, I did also do some work in the mx.binding
> inside
> > > MXRoyale. Maybe the BindingUtils in there is more like what you want?
> (It
> > > is closer to the original Flex)
> > >
> > >
> > >
> > >
> > >
> > > On Fri, Jul 10, 2020 at 10:02 AM Hugo Ferreira <hferreira.80@gmail.com
> >
> > > wrote:
> > >
> > > > The following line of code, compiles without any issue:
> > > > BindingUtils.bindProperty(header, "minimized", content, ["visible"]);
> > > >
> > > > However at runtime, I got the following error on Google Chrome
> Console:
> > > > Uncaught TypeError: Error #1034: Type Coercion failed: cannot convert
> > > > visible to org.apache.royale.crux.binding.BindableChainInfo
> > > >     at Function.org.apache.royale.utils.Language.as
> (Language.js:115)
> > > >     at
> > Function.org.apache.royale.crux.binding.BindingUtils.bindProperty
> > > > (BindingUtils.js:73)
> > > >     at
> > > >
> > > >
> > >
> >
> pt.solidsoft.gc.view.login.Login.pt.solidsoft.framework.form.Form.addElement
> > > > (Form.mxml:32)
> > > >     at
> > > >
> > > >
> > >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
> > > > (MXMLDataInterpreter.js:241)
> > > >     at
> > > >
> Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLArray
> > > > (MXMLDataInterpreter.js:127)
> > > >     at
> > > >
> > >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLInstances
> > > > (MXMLDataInterpreter.js:271)
> > > >     at
> > > >
> > > >
> > >
> >
> pt.solidsoft.gc.view.login.Login.org.apache.royale.jewel.Container.addedToParent
> > > > (Container.js:76)
> > > >     at
> > > > org.apache.royale.html.Group.org.apache.royale.core.UIBase.addElement
> > > > (UIBase.js:405)
> > > >     at
> > > >
> > org.apache.royale.html.Group.org.apache.royale.core.GroupBase.addElement
> > > > (GroupBase.js:165)
> > > >     at
> > > >
> > > >
> > >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
> > > > (MXMLDataInterpreter.js:241)
> > > >
> > > > An explanation:
> > > > header is the source instance of a component
> > > > minimized is the public Bindable property that I'm listening
> > > > content is the target instance of a component
> > > > visible is the visibility of the target that I want to depend on the
> > > > minimized property
> > > >
> > > > Is this a bug that I should insert on github issues or I'm doing
> > > something
> > > > wrong ?
> > > >
> > >
> >
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>

Re: BindingUtils.bindProperty - Issue or I'm doing something wrong ?

Posted by Carlos Rovira <ca...@apache.org>.
Hi Hugo,
you can use MXRoyale in "Royale only" (i.e: jewel) apps.
You must to be careful, but code like RPC classes, validators, and probably
BindingUtils can be used.
I think while you don't use "visual" things, that should be ok. It maybe
would require you to try it, but at least RPC classes are working for many
others and I used as well some validators time ago.

El vie., 10 jul. 2020 a las 0:39, Hugo Ferreira (<hf...@gmail.com>)
escribió:

> OK.
> I'm using Royale only, so BindingUtils (mx version) is not available in my
> case.
> I will try to workaround in a different way (for sure I have to write more
> code) but yes, BindingUtils is a short way in a single line to do the
> things (it will be a missing feature).
>
> Greg Dove <gr...@gmail.com> escreveu no dia quinta, 9/07/2020 à(s)
> 23:34:
>
> > When I originally wrote that, it was not intended to be used directly in
> > code, it was intended to support the metadata-driven injected bindings,
> > specifically with Crux. It is quite specific for Crux.
> > It does need BindableChainInfo instances in that last argument instead of
> > strings. Perhaps the code can be adapted to be more useful other than
> with
> > Crux, but would need some time and effort focused on that.
> > Is it not viable to use injection in your case?
> >
> > Since I worked on that, I did also do some work in the mx.binding inside
> > MXRoyale. Maybe the BindingUtils in there is more like what you want? (It
> > is closer to the original Flex)
> >
> >
> >
> >
> >
> > On Fri, Jul 10, 2020 at 10:02 AM Hugo Ferreira <hf...@gmail.com>
> > wrote:
> >
> > > The following line of code, compiles without any issue:
> > > BindingUtils.bindProperty(header, "minimized", content, ["visible"]);
> > >
> > > However at runtime, I got the following error on Google Chrome Console:
> > > Uncaught TypeError: Error #1034: Type Coercion failed: cannot convert
> > > visible to org.apache.royale.crux.binding.BindableChainInfo
> > >     at Function.org.apache.royale.utils.Language.as (Language.js:115)
> > >     at
> Function.org.apache.royale.crux.binding.BindingUtils.bindProperty
> > > (BindingUtils.js:73)
> > >     at
> > >
> > >
> >
> pt.solidsoft.gc.view.login.Login.pt.solidsoft.framework.form.Form.addElement
> > > (Form.mxml:32)
> > >     at
> > >
> > >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
> > > (MXMLDataInterpreter.js:241)
> > >     at
> > > Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLArray
> > > (MXMLDataInterpreter.js:127)
> > >     at
> > >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLInstances
> > > (MXMLDataInterpreter.js:271)
> > >     at
> > >
> > >
> >
> pt.solidsoft.gc.view.login.Login.org.apache.royale.jewel.Container.addedToParent
> > > (Container.js:76)
> > >     at
> > > org.apache.royale.html.Group.org.apache.royale.core.UIBase.addElement
> > > (UIBase.js:405)
> > >     at
> > >
> org.apache.royale.html.Group.org.apache.royale.core.GroupBase.addElement
> > > (GroupBase.js:165)
> > >     at
> > >
> > >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
> > > (MXMLDataInterpreter.js:241)
> > >
> > > An explanation:
> > > header is the source instance of a component
> > > minimized is the public Bindable property that I'm listening
> > > content is the target instance of a component
> > > visible is the visibility of the target that I want to depend on the
> > > minimized property
> > >
> > > Is this a bug that I should insert on github issues or I'm doing
> > something
> > > wrong ?
> > >
> >
>


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

Re: BindingUtils.bindProperty - Issue or I'm doing something wrong ?

Posted by Hugo Ferreira <hf...@gmail.com>.
OK.
I'm using Royale only, so BindingUtils (mx version) is not available in my
case.
I will try to workaround in a different way (for sure I have to write more
code) but yes, BindingUtils is a short way in a single line to do the
things (it will be a missing feature).

Greg Dove <gr...@gmail.com> escreveu no dia quinta, 9/07/2020 à(s)
23:34:

> When I originally wrote that, it was not intended to be used directly in
> code, it was intended to support the metadata-driven injected bindings,
> specifically with Crux. It is quite specific for Crux.
> It does need BindableChainInfo instances in that last argument instead of
> strings. Perhaps the code can be adapted to be more useful other than with
> Crux, but would need some time and effort focused on that.
> Is it not viable to use injection in your case?
>
> Since I worked on that, I did also do some work in the mx.binding inside
> MXRoyale. Maybe the BindingUtils in there is more like what you want? (It
> is closer to the original Flex)
>
>
>
>
>
> On Fri, Jul 10, 2020 at 10:02 AM Hugo Ferreira <hf...@gmail.com>
> wrote:
>
> > The following line of code, compiles without any issue:
> > BindingUtils.bindProperty(header, "minimized", content, ["visible"]);
> >
> > However at runtime, I got the following error on Google Chrome Console:
> > Uncaught TypeError: Error #1034: Type Coercion failed: cannot convert
> > visible to org.apache.royale.crux.binding.BindableChainInfo
> >     at Function.org.apache.royale.utils.Language.as (Language.js:115)
> >     at Function.org.apache.royale.crux.binding.BindingUtils.bindProperty
> > (BindingUtils.js:73)
> >     at
> >
> >
> pt.solidsoft.gc.view.login.Login.pt.solidsoft.framework.form.Form.addElement
> > (Form.mxml:32)
> >     at
> >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
> > (MXMLDataInterpreter.js:241)
> >     at
> > Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLArray
> > (MXMLDataInterpreter.js:127)
> >     at
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLInstances
> > (MXMLDataInterpreter.js:271)
> >     at
> >
> >
> pt.solidsoft.gc.view.login.Login.org.apache.royale.jewel.Container.addedToParent
> > (Container.js:76)
> >     at
> > org.apache.royale.html.Group.org.apache.royale.core.UIBase.addElement
> > (UIBase.js:405)
> >     at
> > org.apache.royale.html.Group.org.apache.royale.core.GroupBase.addElement
> > (GroupBase.js:165)
> >     at
> >
> >
> Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
> > (MXMLDataInterpreter.js:241)
> >
> > An explanation:
> > header is the source instance of a component
> > minimized is the public Bindable property that I'm listening
> > content is the target instance of a component
> > visible is the visibility of the target that I want to depend on the
> > minimized property
> >
> > Is this a bug that I should insert on github issues or I'm doing
> something
> > wrong ?
> >
>

Re: BindingUtils.bindProperty - Issue or I'm doing something wrong ?

Posted by Greg Dove <gr...@gmail.com>.
When I originally wrote that, it was not intended to be used directly in
code, it was intended to support the metadata-driven injected bindings,
specifically with Crux. It is quite specific for Crux.
It does need BindableChainInfo instances in that last argument instead of
strings. Perhaps the code can be adapted to be more useful other than with
Crux, but would need some time and effort focused on that.
Is it not viable to use injection in your case?

Since I worked on that, I did also do some work in the mx.binding inside
MXRoyale. Maybe the BindingUtils in there is more like what you want? (It
is closer to the original Flex)





On Fri, Jul 10, 2020 at 10:02 AM Hugo Ferreira <hf...@gmail.com>
wrote:

> The following line of code, compiles without any issue:
> BindingUtils.bindProperty(header, "minimized", content, ["visible"]);
>
> However at runtime, I got the following error on Google Chrome Console:
> Uncaught TypeError: Error #1034: Type Coercion failed: cannot convert
> visible to org.apache.royale.crux.binding.BindableChainInfo
>     at Function.org.apache.royale.utils.Language.as (Language.js:115)
>     at Function.org.apache.royale.crux.binding.BindingUtils.bindProperty
> (BindingUtils.js:73)
>     at
>
> pt.solidsoft.gc.view.login.Login.pt.solidsoft.framework.form.Form.addElement
> (Form.mxml:32)
>     at
>
> Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
> (MXMLDataInterpreter.js:241)
>     at
> Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLArray
> (MXMLDataInterpreter.js:127)
>     at
> Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLInstances
> (MXMLDataInterpreter.js:271)
>     at
>
> pt.solidsoft.gc.view.login.Login.org.apache.royale.jewel.Container.addedToParent
> (Container.js:76)
>     at
> org.apache.royale.html.Group.org.apache.royale.core.UIBase.addElement
> (UIBase.js:405)
>     at
> org.apache.royale.html.Group.org.apache.royale.core.GroupBase.addElement
> (GroupBase.js:165)
>     at
>
> Function.org.apache.royale.utils.MXMLDataInterpreter.initializeStrandBasedObject
> (MXMLDataInterpreter.js:241)
>
> An explanation:
> header is the source instance of a component
> minimized is the public Bindable property that I'm listening
> content is the target instance of a component
> visible is the visibility of the target that I want to depend on the
> minimized property
>
> Is this a bug that I should insert on github issues or I'm doing something
> wrong ?
>