|
问题是这样的,某个页面中的一个Frame中可以新增若干个WebEdit,而且WebEdit的name属性中包含随机数,
所以我就想用描述性编程实现在WebEdit中输入值,现在我提取到了name属性,也定义了type,html tag等属性值,
可是运行时还是报错
部分代码
Function ChildObjects_WebEdit(parent)
Dim NumberOfEdits,msg
Set oDesc = Description.Create()
oDesc("micclass").Value = "WebEdit"
Set EditCollection = parent.ChildObjects(oDesc)
NumberOfEdits = EditCollection.Count
For i = 0 To NumberOfEdits - 1
msg = EditCollection(i).GetROProperty("name")
IsReceipt = IsAvailable("bn_receipts\$\$TableRowKey",msg) '判断bn_receipts\$\$TableRowKey"此字符串是否在msg中
IsPay = IsAvailable("bn_pays\$\$TableRowKey",msg)
If IsReceipt Then
Set oWebEdit = Description.Create()
oWebEdit("name").Value = msg
oWebEdit("type").Value = "text"
oWebEdit("html tag").value = "INPUT"
If IsAvailable("bn_receipts_feeitem",msg) Then
parent.WebEdit(oWebEdit).FireEvent "onfocus"
parent.WebEdit(oWebEdit).FireEvent "onmousedown"
parent.WebEdit(oWebEdit).Set "并单费"
End If
End If
Next
End Function |
|