Hey there,
you can set up the class com.ibm.xsp.model.DataSource in the class of your property in the Custom Control. Then you can pass on the name of the datasource in the XPage. But it has to be like that:
#{nameOfDatasource}
No, the javascript is not missing, this is expression language, with that you can pass on the datasource directly. But be careful, it can happen that you save the datasource more than once.
An alternative would be to pass on the backend documentdirectly, or you pass on the UNID of the document and create your own datasource in your custom control.Everythings possible. Please ask if you have further problems, it is likely that some will occur.