This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 12, 2011, 9:14 AM
178 Posts

2 datasources on 1 XPage - Shared fields?

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: shared field,data source
  • Replies: 4
What is the best way to bind 1 field to more than one data source?
Mar 12, 2011, 1:13 PM
149 Posts
Re: 2 datasources on 1 XPage - Shared fields?
what have you tried?
Mar 13, 2011, 9:16 AM
178 Posts
Re: 2 datasources on 1 XPage - Shared fields?
nothing, I could not find a standard out of the box property for it. or is there?
Mar 21, 2011, 3:25 PM
1 Posts
Re: 2 datasources on 1 XPage - Shared fields?
I am not sure if this has a solution in the standard xpages solutions.
 
Have your tried creating two Custome Controls, one for each form and on both forms add the shared fields and on one form hide the display of the field.

or if that does not work, you could consider a post-save event for one of the forms to write the shared field values from the other form.
Mar 13, 2011, 6:53 PM
41 Posts
Re: 2 datasources on 1 XPage - Shared fields?
 What's the use case? If you were to bind the same component to multiple data sources (which I don't think is possible, actually, at least not the standard document data source), you'd be duplicating storage of that component's value. I can see why you'd merge data from multiple data sources into a single "form" (i.e. a contact page might allow the user to view / edit information specific to a contact as well as information generic to their company), but I'm not sure what the value would be in binding a single component to more than one data source.
 
If, however, you do want the value of a single component written to multiple documents in a single edit, the easiest approach I know of is to bind it to a managed bean. This allows you full control over where the data is written to when the data source is saved. You could, of course, also define a custom data source, but that's slightly more complicated. 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal