Created By  inflectra.adam Thursday, August 15, 2013
This article describes how to access child objects of a Learned Java AWT/Swing object when using the Rapise Java library. Sometimes when you Learn a top-level object, you want to be able to programmatically query the object to locate the child objects that are visible in the Java SPY.

When you have learned a Java object using CTRL+2 you can dump its properties using:

 var obj = SeS('jTree1');
 var dump = obj.DoDumpWidget(true, -1, null, null, null, null, null);

To programmatically access a simple top-level property of this object is easy:

var propValue = SeSGetJavaProperty(obj,'propName');

However to get a child object's properties, you need to first get the child object and then query that for the property in question. The following code gets a property from the first child object:

 var childCount = SeSGetJavaChildrenCount(obj.instance);
 var child = SeSGetJavaChildAt(obj.instance, 0);
 var childPropValue = SeSGetJavaProperty(child,'propName');


Article Info
  • Last Updated: 8/15/2013
  • Article ID: KB57
  • Views: 3412