Form control get datasource name

Is it possible to get the datasource name of a form control as it run?

I have a field link to a datasource, and when I use the method

mouseDown(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift)

I want to have an info box with the datasource name linked to this control.


I don’t know any easier way (it’s not too bad anyway):

int dsId = this.dataSource();
int i;
FormDataSource fds;

for (i = 1; i <= element.dataSourceCount(); i++)
    fds = element.dataSource(i);
    if ( == dsId)