Common Function for All Types of Dropdown Field and Edit Fields in My Application

Total Page:16

File Type:pdf, Size:1020Kb

Common Function for All Types of Dropdown Field and Edit Fields in My Application

 Common Function for all types of Dropdown field and Edit fields in my application

Function FnSetDropDownField(argFieldDropName,ArgValue,WinDiagName)

Dim StrEnd, StrPageStart, strBrowStart, strPage, strBrow, MyStringValue, MyStringName, MyArrayName, MyArrayValue strEnd = ".*" strPageStart = "title:=.*" strBrowStart = "name:=.*" MyStringValue = argvalue MyStringName = argFieldDropName strPage = strPageStart&WinDiagName &strEnd strBrow = strBrowStart&WinDiagName &StrEnd

MyArrayValue = Split(MyStringValue, ";") i=0 For Each MyDefaultItems in MyArrayValue

'Array to read Name values MyArrayName = Split(MyStringName, ";")

set editFieldDropDesc= description.Create() editFieldDropDesc("name").Value = MyArrayName(i) editFieldDropDesc("class").Value = "FieldContentInput"

Set fieldColl = Browser(strBrow).Page(strPage).ChildObjects(editFieldDropDesc)

Testthis = fieldColl(0).getROProperty("MicClass")

' Loop to set or select based on Class Name... If fieldColl(0).getROProperty("MicClass") = "WebEdit" Then If fieldColl.count > 0 Then fieldColl(0).Set(MyDefaultItems) End If Else If fieldColl.count > 0 Then fieldColl(0).Select(MyDefaultItems) End If End If

If FnGetCompareDropDownFieldVal(MyArrayName(i),WinDiagName)=MyDefaultItems Then Passed "PASS: Field Set","Field " &MyArrayName(i) &" set correctly to = " &MyDefaultItems &"." FnSetDropDownField="TRUE" else WARN "FAILED: Field Set","Field not set correctly to, " &MyDefaultItems &"." FnSetDropDownField="FALSE" End If i=i+1 Next End Function

'*'**********************************************************************

Call the Function for a field: for example: FnSetDropDownField DataTable("FileIDField", dtLocalSheet),DataTable("FileIDField_Input", dtLocalSheet),"Feedback"

But when I use/call the same function for a field in a popup window, my function doesn’t work. Should I use the same function or modify it so that it works for everywhere in my app? Or should I create a new function. The spied the Field in the popup as its as below:

Recommended publications