don't require all objects to have id properties
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/d4d2ae9a Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/d4d2ae9a Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/d4d2ae9a Branch: refs/heads/develop Commit: d4d2ae9a1c7bae98706d3a49db30db274f2516aa Parents: 4a76018 Author: Alex Harui <[email protected]> Authored: Thu Oct 2 12:43:01 2014 -0700 Committer: Alex Harui <[email protected]> Committed: Thu Oct 2 12:58:45 2014 -0700 ---------------------------------------------------------------------- .../src/org/apache/flex/utils/MXMLDataInterpreter.as | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4d2ae9a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MXMLDataInterpreter.as ---------------------------------------------------------------------- diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MXMLDataInterpreter.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MXMLDataInterpreter.as index ec96f89..94b59d7 100644 --- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MXMLDataInterpreter.as +++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MXMLDataInterpreter.as @@ -180,6 +180,16 @@ public class MXMLDataInterpreter comp.document = document; else if (name == "_id") id = value as String; // and don't assign to comp + else if (name == "id") + { + // not all objects have to have their own id property + try { + comp["id"] = value; + } catch (e:Error) + { + + } + } else comp[name] = value; }
