How can custom control inherit the document

I need a custom control to bind to the document of the parent xPage (or other custom control) that it is embedded into.

I can’t find a way to easily do this. The work around I have found is to not create a datasource at all in the custom control. I then just enter the value parameter for the field in the source ( value=“#document1.fieldname}” ) and it works fine.

However, the problem with this is because the datasource was not actually defined in the custom control, when I use the regular DDE interface to edit the field, it completely loses the binding. The DDE bind to field wants you to select a field from the datasource - but there is no datasource so the bindto field is blank.

My guess is one of the properties for the data source will allow you to link it to a parent datasource. But I can’t seem to figure it out.

As always - thanks in advance for any assistance.

Subject: Use the Source, Barry…

  • Simply use the Source tab to enter your data bindings. Anything that appears on any page or custom control containing a data source has full access to that data source intrinsically. This appears to work for any combination of data sources as well, so if one custom control has a data source and a custom control, and that subordinate control has a data source, then that subordinate control has access to both data sources.

  • This is also true for anything. Script libraries, CSS includes, whatever. It’s all available to anything that’s subordinate to the element where it appears. I have a template custom control that every single web page is subordinate to. I have one server side and one client side library defined as resources on that template so every single component and control on every web page has access to those two libraries, since I use them seemingly everywhere.

  • That’s been my experience. This aspect of XPages, at least, works simply and intuitively.

Hope this helps…

Subject: i have same problem!!!

Did you resolved that problem???

Thnaks

Diego

Subject: Try this…

Either my solution or the one in the linked document may help. I am not sure if the linked example works in 8.5 as I am using 8.5.1.

http://www-10.lotus.com/ldd/nd85forum.nsf/5f27803bba85d8e285256bf10054620d/0f198651c072d26d852576f1007269cc?OpenDocument