0
votes

I guess that I am really missing something on the datasource in a custom control. When I create the custom control I have no idea what the name of the datasource on the XPage is going to be. I have added a custom property to the custom control to pass using the Type com.ibm.xsp.domino.model.DominoDocumentData and the Method Binding Editor, and this sort of seems to work if the Custom Control does not contain Custom Controls. At which point either I am getting lost or the XPage/Custom Control binding is getting lost.

Here is what I am trying to do I have created a Tab Table using the Extension Library and have placedd it on a cc. I have set up several tabs on it. Because the amount of information on each tab is pretty extensive I thought I would create a custom control for each tab. Then I ask the Yes/No question on almost every line I created a ccYN custom control, plus a couple of other ones as well because they can be reused and simple bound to a different fieldName that I have set up in the cc Properties. I see where others have said that if the datasource is defined for the XPage that it is available to all of the cc's, the method above seems to work for the first level but deeper than that leaves me or the XPage really confused. I have searched the internet/read Mastering Xpages but am not much further ahead.

2

2 Answers

0
votes

It has been a long drawn out process but I think I have it now. On the Custom Control create a Property definition with a type of com.ibm.xsp.model.ModelDataSource with an edit type of String and call it something say ccDataSource. Then bind the the ccDataSource to the datasource of the XPage that contains it when it is know using SSJS so say it is myDataSource.

If the Custome Control is contained in a custome control and the datasource needs to be passed through another level the the binding is compositeData.ccDatasource or ?? whatever the outer datasource Property definition for the Data Source is.

There might be a cleaner way of doing this but I have not found it.

0
votes

Not sure if you're still looking for an answer, but you can use the data source of "currentDocument" in a custom control. This assumes that the custom control is in a panel with one document data source, or in an XPage with one document data source.