Even if the class as marked as Bindable? On Fri, Dec 9, 2016 at 11:03 AM, Alex Harui <aha...@adobe.com> wrote:
> > > On 12/9/16, 10:59 AM, "omup...@gmail.com on behalf of OmPrakash Muppirala" > <omup...@gmail.com on behalf of bigosma...@gmail.com> wrote: > > >On Fri, Dec 9, 2016 at 10:50 AM, Alex Harui <aha...@adobe.com> wrote: > >> > >> The binding warning is legitimate. It says that there aren't change > >> events for data.foo. That could bite you some day, but is ok in this > >> particular situation. The "correct" answer is to use ValueObjects and > >> cast the data binding expression as I showed, but that can be a pain for > >> prototyping. It turns out that with FlexJS, you can suppress this > >>binding > >> warning for simple binding expressions by making a fake ValueObject with > >> the required properties and casting. The data binding code doesn't > >> type-check so you can get away with it. I just pushed a prototype of an > >> ASDoc app with a fake ValueObject and suppressed warnings via casting in > >> the SummaryRenderer.mxml and DetailRenderer.mxml > >> > >> > >I am wondering if we should create a new marker interface like > >IBindableObject and use that in the data setter/getter? > > > >Something like: > > > >public function set data(v:IBindableObject) { > >} > > > >And my value objects look like this: > > > >[Bindable] > >public class SimpleVO implements IBindableObject { > >... > >} > > > >IBindableObject could just be an empty, i.e. marker interface. > > > >Then there is no need to cast in the code. Also, maybe the compiler can > >be > >trained to not throw bindable warnings when it sees IBindableObject as the > >type? > > > >Not sure if I am missing something with this approach. > > I don't think that would help. The individual properties on data still > wouldn't have any change event metadata. > > -Alex > >