Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context Class: contextView property set twice with binding expression and throws error #24

Closed
mfdj opened this issue Oct 9, 2011 · 5 comments
Assignees

Comments

@mfdj
Copy link

mfdj commented Oct 9, 2011

I was playing around with this HelloWorld example and I ran into a problem using Context inside the Declerations tag:

<fx:Declarations>
    <context:AppContext contextView="{this}" />
</fx:Declarations>

The probelm was that the contextView was getting set twice, which seems to cause Robotlegs 1.5.0 to freak out.

I'm using Flex 4.5.1 and Flash Builder 4.5.

I created some tests and it seems that any class declared in the Declarations tag will get properties with binding expressions set twice. Always, even if the binding is to a property of a basic type, like Number, who's value does not change at any point.

Weirdly, if the class is declared in the root-tag/DispalyList (in my case I created a test that extended UIComponent, so it could exist outside the Declarations tag) this double setting of the properties with binding expressions does not seem to occur.

I don't know if this is some weird configuration thing with my Flex setup, or if this is a 4.5 only issue… but I thought I'd bring it up as it was very frustrating because I liked the style of declaring the context as a tag, instead of using raw Actionscript.

My workaround is to patch it when extending Context — my AppContext.as has this:

override public function set contextView(value:DisplayObjectContainer):void
{
    if ( ! contextView ) super.contextView = value;
}

Basically it just ensures that if contextView has already been set, it doesn't get set again.

Let me know if I'm missing something.

@darscan
Copy link
Member

darscan commented Oct 9, 2011

Thanks for the bug report. Working on a proper fix. Will release asap.

@ghost ghost assigned darscan Oct 9, 2011
@darscan
Copy link
Member

darscan commented Oct 9, 2011

RL 1.5.1 bugfix release: http://www.robotlegs.org/

@darscan darscan closed this as completed Oct 9, 2011
@darscan darscan reopened this Oct 9, 2011
@darscan
Copy link
Member

darscan commented Oct 9, 2011

When you get a chance could you download the latest release and confirm the fix?

@mfdj
Copy link
Author

mfdj commented Oct 9, 2011

Fix confirmed!
Thanks. For the fix and the framework ;-)

@mfdj mfdj closed this as completed Oct 9, 2011
@darscan
Copy link
Member

darscan commented Oct 9, 2011

It's a pleasure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants