0

My application has documents for Companies, and for Clients. This is a many to many relationship; a company can have any number of clients, and a client can be a client of many companies. The relationships are stored by creating a response document to the company, with a field containing the ID of the client document.

I would like to be able to show fields from the client document on the company's XPage, and I've been trying to do this with repeat controls. I created a view of all the link documents, and used that to create a repeat, filtering it with the current document ID to collect all the links that the current company has. This allows me to list all the IDs of the client documents associated with that company.

I have been trying to work out how to pass this ID to a repeat control nested within the first one, either to use it as a filter on a view of all the client documents, or to use it as the data source document ID directly. Is this possible? If not, how would I go about showing data from the client document on the company page?

Josh Jolly
  • 11,258
  • 2
  • 39
  • 55

1 Answers1

0

When you specify a repeat control you specify the variable that contains the instance value. This variable name is visible to anything inside the repeat control. So your variable would contain the UNID of the client documents one at a time. E.g you call it ClientDocID. You put a panel inside that repeat control. That panel can have its own DominoDocument data source. The datasource can have new, display or edit as default action. You pick "display" which requires a DocumentId to be provided. Select "computed" and simply use ClientDocID as formula.

You can suppress rendering of HTML for the panel (check the properties), so it would fit e.g. inside a xp:tr.

Hope that helps

stwissel
  • 20,110
  • 6
  • 54
  • 101
  • I tried this:` ` with no luck, what am I doing wrong? – Josh Jolly Jul 26 '12 at 10:47
  • I can display the ID of the document I want to open within the panel, and I can access the data in it by putting the ID into a computed field called "test" and using stuff like: `database.getDocumentByUNID(getComponent("test").getValue()).getItemValueString("PL_Phone")` but this seems like a messy workaround? – Josh Jolly Jul 26 '12 at 15:01
  • Linkdata is what type? Xspviewentry? Then pick the right method for the unid and u can use document2.pl-phone. The UI actually should offer the field names to you – stwissel Jul 26 '12 at 23:38
  • Lose the javascript prefix in your documentId binding, and set ignoreRequestParams to true. – Tim Tripcony Aug 22 '12 at 03:39