flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From OmPrakash Muppirala <bigosma...@gmail.com>
Subject Re: [FlexJS][Maven] Build failure caused by compiler warnings (was: Re: [FlexJS] How Binding works?)
Date Fri, 09 Dec 2016 18:59:38 GMT
On Fri, Dec 9, 2016 at 10:50 AM, Alex Harui <aharui@adobe.com> wrote:

> On 12/9/16, 10:25 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
> <carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:
> >You're right, compile is working, but message was confused (BUILD FAILURE)
> >
> >Maybe Chris could help with this?
> Well, I'm sure he can, but Chris did want our stuff to compile without
> warnings, so I think he set Maven to fail on warnings.  I'm fine with that
> rule:  we should have ways to suppress warnings individually because
> sometimes a warning is important.
> 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:

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

Not sure if I am missing something with this approach.


> HTH,
> -Alex
> >>>
> >> >The project 'App' has been successfully compiled and optimized.
> >> >/Users/carlosrovira/Dev/Flex/source/flexjs/flex-asjs/
> >> examples/flexjs/MDLEx
> >> >ample/src/main/flex/itemRenderers/CustomListItemRenderer.mxml(28):
> >> >col: 12 Data binding will not be able to detect assignments to 'label'.
> >> >text="{data.label}" >
> >> >           ^

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message