I have a custom control that contains a repeat control, displaying search results. I am wanting to display the number of results, but in a computed text field outside of the custom control.
I can get the count using the following code (on the main XSP), but only in the AfterRenderResponse event, which is too late to update the computed field apparently:
component = getComponent(“myCustomControl”);
var childNodes = component.getChildren();
for( var i = 0; i < childNodes.length; i++ ){
if( typeof childNodes[i] === 'com.ibm.xsp.component.xp.XspDataIterator' ){
var repeater:com.ibm.xsp.component.xp.XspDataIterator = childNodes[i];
var myCount = repeater.getRowCount();
break;
}
}
Am I missing something simple?
Thanks,
Karl