Forum Discussion
HKosova
Alumni
14 years agoHi Vijay,
Glad to hear the script worked fine for you!
As for the snippet you asked about:
This code essentially locates a drop-down list item (the item object) in a Spark DropDownList control (the ListObject object).
The thing is that in the object hierarchy, drop-down list items aren't child objects of the DropDownList control itself — they are child objects of the main Flex application. So, the script first goes up the object hierarchy until it finds the Flex application's root object — an object with the ObjectType property equal to Object. After that, it uses FindChild to search for the list item object by its text.
Let me know if you need anymore clarifications.
Glad to hear the script worked fine for you!
As for the snippet you asked about:
' Go up the object hierarchy until the common parent object
Set app = ListObject.Parent
Do Until app.ObjectType = "Object"
Set app = app.Parent
Loop
' Find the list item object by text
propNames = Array("ObjectType", "Caption")
propValues = Array("ListItem", ItemText)
Set item = app.FindChild(propNames, propValues, 5)
This code essentially locates a drop-down list item (the item object) in a Spark DropDownList control (the ListObject object).
The thing is that in the object hierarchy, drop-down list items aren't child objects of the DropDownList control itself — they are child objects of the main Flex application. So, the script first goes up the object hierarchy until it finds the Flex application's root object — an object with the ObjectType property equal to Object. After that, it uses FindChild to search for the list item object by its text.
Let me know if you need anymore clarifications.