【发布时间】:2014-12-01 22:43:38
【问题描述】:
我一直在构建我的第一个 Titanium Alloy 应用程序,我有一个 5 步注册表单,其中包含分布在 5 个视图中的不同表单字段。在我的最后一步中,我想发布表单元素的值。访问每个字段值的最佳方法是什么?例如。在 screen5 中如何获取 screen1 视图中 $.name 字段的值?
这是我的一些代码:
<ScrollableView id="indexSV" showPagingControl="false" scrollingEnabled="false" top="0">
<Require src="screen1" id="screen1"></Require>
<Require src="screen2" id="screen2"></Require>
<Require src="screen3" id="screen3"></Require>
<Require src="screen4" id="screen4"></Require>
<Require src="screen5" id="screen5"></Require>
</ScrollableView>
屏幕的结构如下:
<Alloy>
<View>
<Label top="20">YOUR NAME:</Label>
<TextField top="5" id="name" />
<Button top="20" right="10%" id="btnNext" width="120" onClick="next" class="next">NEXT STEP</Button>
</View>
</Alloy>
【问题讨论】: