Flex binding tip when adding components dynamically
Today I was developing this UI using Flex where a panel is added as a child dynamically. Inside the Panel there is a form with a series of input elements, and I use Binding to put back the changes of an Input component into the object that originally had the text.
A weird problem occured: The input text was empty even though the property in the object has some text. I tested by removing the Binding and was able to see the text in the Input. Weird… I’ve done this so many times before and never had a problem.
Well, it turns out that if you set the object where the Input grabs the text from before adding the component to the tree of UIComponents for some reason the Binding messes up. So the solution was adding the Panel to the parent and then setting this object where Input grabs the text from.
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.
Comments
No comments yet.
Leave a comment