/** * getDatasource * Resolves a datasource from a custom control * * @param componentId id of the component containing the datasource * @param dsName name of the datasource in the component * @author Sven Hasselbach */ function getDatasource( componentId:String, dsName:String ) { try{ var data:java.util.ArrayList = getComponent( componentId ).getAttributes().get("data"); if( data == null ) return null; var it:java.util.Iterator = data.iterator(); var obj = null; while( it.hasNext() ){ obj = it.next(); if( obj.getVar() == dsName ) return obj; } }catch(e){ print( e ); } }