51Testing软件测试论坛
标题:
Read Only 控件如何做关联?
[打印本页]
作者:
fessor21
时间:
2010-2-1 18:37
标题:
Read Only 控件如何做关联?
案例: Page1 有几个 字段, 比如 OrderNumber,ID 等, OrderNumber ID 将从动态从数据库取值。ordernumber 脚本初始值 :123456.
Page2 控件之一textbox 是引用Page1 页面 的 OrderNumber。而且只能引用,用户不能输入,属性是readonly .
在脚本中为orderNumber 做关联,Page2 总是取初始值 :123456, 无法随着 Page1 里 OrderNumber 动态改变。即关联无效!
请问大家有好建议,谢谢!
作者:
aman_cao
时间:
2010-2-1 18:45
重新关联,在page2中使用关联的变量即可
如果不想使用初始化值,可以选择菜单下的parameter list,选择左下方的new,这样将不出有初始值。
作者:
fessor21
时间:
2010-2-1 21:11
是的,page 2开始引用正确,当页面保存后就不对了。 请看下面的图。
[
本帖最后由 fessor21 于 2010-2-1 22:55 编辑
]
作者:
aman_cao
时间:
2010-2-2 09:46
不太清楚你说的保存操作是指什么
你发一下保存操作对应的脚本吧,不会是因为保存操作还引用了默认的数据而出现的总是吧?
作者:
fessor21
时间:
2010-2-2 14:07
web_reg_save_param("headerID2",
"LB=name=\"rdoHeaderID\" value=\"",
"RB=\"",
"Ord=1",
"RelFrameId=1",
"Search=Body",
"SaveLen=8",
LAST);
web_reg_save_param("ordernumber",
"LB=name=\"rdoHeaderID\" value=\"",
"RB=\"",
"Ord=1",
"RelFrameId=1",
"Search=Body",
"SaveOffset=9",
"SaveLen=8",
LAST);
=== Page1:
web_url("ToDoList.aspx",
"URL=http://192.168.1.100/test/case/ToDoList.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.1.100/test/home.aspx",
"Snapshot=t168.inf",
"Mode=HTML",
EXTRARES,
"URL=/test/JavaScript/ExGridView.js", ENDITEM,
"URL=/test/images/tab-bg.gif", ENDITEM,
"URL=/test/images/subtoolbar-bg.gif", ENDITEM,
"URL=/test/images/sample-list-page-bg.gif", ENDITEM,
"URL=/test/images/sample-list-mdl-tr.gif", ENDITEM,
"URL=/test/images/sample-list-mdl-tl.gif", ENDITEM,
"URL=/test/images/sample-list-mdl-bl.gif", ENDITEM,
LAST);
== Page1_2
web_submit_data("ToDoList.aspx_2",
"Action=http://192.168.1.100/test/case/ToDoList.aspx",
"Method=POST",
"RecContentType=text/plain",
"Referer=http://192.168.1.100/test/case/ToDoList.aspx",
"Snapshot=t170.inf",
"Mode=HTML",
ITEMDATA,
"Name=rdoHeaderID", "Value={headerID2}|{ordernumber}", ENDITEM,
"Name=ctl00_pageBody_QueryBossOrder1_gvBossList_GoPage", "Value=", ENDITEM,
"Name=__ASYNCPOST", "Value=true", ENDITEM,
LAST);
== Page2:
web_url("RegisterDetail.aspx",
"URL=http://192.168.1.100/test/case/RegisterDetail.aspx?SourceType=1&CreateType=0&HeaderID={headerID2}&BossOrder={ordernumber}",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.1.100/test/case/ToDoList.aspx",
"Snapshot=t171.inf",
"Mode=HTML",
EXTRARES,
"URL=/test/javascript/jquery-1.3.2.js", "Referer=http://192.168.1.100/test/case/RegisterDetail.aspx?SourceType=1&CreateType=0&HeaderID={headerID2}&BossOrder={ordernumber}", ENDITEM,
"URL=/test/ScriptResource.axd?d=DY-3_zDfTHQ7rfiv3v-mZN7VdWjB-I-1gTCKr_0x6w5BXDZIn0KGxn-mAntTvd9X9-mK1Db_MfX2Mcd-wq7y4g2&t=3888d49", "Referer=http://192.168.1.100/test/case/RegisterDetail.aspx?SourceType=1&CreateType=0&HeaderID={headerID2}&BossOrder={ordernumber}", ENDITEM,
"URL=AjaxForm.aspx?Flag=0&CaseID=&CustomerID={applicantID}", "Referer=http://192.168.1.100/test/case/RegisterDetail.aspx?SourceType=1&CreateType=0&HeaderID={headerID2}&BossOrder={ordernumber}", ENDITEM,
LAST);
=== Page3
web_submit_data("RegisterDetail.aspx_2",
"Action=http://192.168.1.100/test/case/RegisterDetail.aspx?SourceType=1&CreateType=0&HeaderID={headerID2}&BossOrder={ordernumber}",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.1.100/test/case/RegisterDetail.aspx?SourceType=1&CreateType=0&HeaderID={headerID2}&BossOrder={ordernumber}",
"Snapshot=t173.inf",
"Mode=HTML",
ITEMDATA,
"Name=ctl00$modalDivCallbackTypeTxt", "Value=", ENDITEM,
"Name=ctl00$modalDivCallbackValueTxt", "Value=", ENDITEM,
"Name=ctl00$drpSearchType", "Value=0", ENDITEM,
"Name=ctl00$txtSearchWords", "Value=", ENDITEM,
"Name=ctl00$pageBody$ctl01$txtCaseNo", "Value=", ENDITEM,
"Name=ctl00$pageBody$ctl01$OrderNumber", "Value={ordernumber}", ENDITEM, // ReadOnly, Ordernumber 不能获取到最新值
"Name=ctl00$pageBody$ctl01$drpTeam", "Value=1", ENDITEM,
"Name=ctl00$pageBody$ctl01$txtCS", "Value=Admin", ENDITEM,
"Name=ctl00$pageBody$ctl01$txtCSID", "Value=1", ENDITEM,
"Name=ctl00$pageBody$ctl01$txtPickUpOrderNo", "Value=", ENDITEM,
LAST);
=== Generate log of RegisterDetail.aspx
</td>
<td>
<input name="ctl00$pageBody$ctl02$txtOrderNumber" type="text" value="50000421" readonly="readonly" id="ctl00_pageBody_ctl02_txtBossOrderNo" style="background-color:#efefef;width:150px;" />
</td>
<td height="20">
作者:
chengning
时间:
2010-2-2 14:20
作者:
fessor21
时间:
2010-2-4 23:29
只能暂时要DEV修改readonly 应付下 了。
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2