diff --git a/Alloy/commands/compile/parsers/Alloy.Require.js b/Alloy/commands/compile/parsers/Alloy.Require.js index de35184df..a94e04ce7 100755 --- a/Alloy/commands/compile/parsers/Alloy.Require.js +++ b/Alloy/commands/compile/parsers/Alloy.Require.js @@ -128,15 +128,24 @@ function parse(node, state, args) { type === 'widget' ? 'Alloy.Widget' : 'Alloy.Require', args.createArgs, state - ) + ');\n'; - if (args.parent.symbol && !state.templateObject && !state.androidMenu) { - code += args.symbol + '.setParent(' + args.parent.symbol + ');\n'; + ) + ')'; + let parent = { symbol: args.symbol }; + if (args.parent.symbol && !state.templateObject && !state.androidMenu && !state.insideContainer) { + code += ';\n' + args.symbol + '.setParent(' + args.parent.symbol + ');\n'; + parent = { + symbol: args.symbol + '.getViewEx({recurse:true})' + }; + } else if ( state.insideContainer ) { + code += ';\n'; + parent = { + symbol: args.symbol + '.getViewEx({recurse:true})' + }; + } else { + code += '.getViewEx({recurse:true});\n'; } return { - parent: { - symbol: args.symbol + '.getViewEx({recurse:true})' - }, + parent: parent, controller: args.symbol, styles: state.styles, code: code diff --git a/Alloy/commands/compile/parsers/Ti.UI.Tab.js b/Alloy/commands/compile/parsers/Ti.UI.Tab.js index 91303d893..f5492bcdd 100755 --- a/Alloy/commands/compile/parsers/Ti.UI.Tab.js +++ b/Alloy/commands/compile/parsers/Ti.UI.Tab.js @@ -26,6 +26,7 @@ function parse(node, state, args) { if (theNode) { code += CU.generateNodeExtended(child, state, { parent: {}, + insideContainer: true, post: function(node, state, args) { windowSymbol = state.parent.symbol; }