I built on the previous XPage example, the Customer Orders application
, to demonstrate how to generate dynamic fields from a document collection. There is a sample database for you to download as well as a powerpoint presentation that explains the steps involved.
Over the years I have developed different techniques to handle dynamic fields in Domino applications. I'm sure many of you have also tackled this issue in various ways. In XPages there are built in controls that you can utilize to address this issue.
In the previous example I demonstrated how XPages allows you to bind your controls on the page to multiple datasources. In this example I take it up a notch by showing how you can repeat a panel control that is bound to a document multiple times, thereby binding edit controls to a collection of Notes documents. XPages maintains the binding so that all the documents are updated from a single button with a single simple action "Save Datasources".
Here's the use case: When a Customer Order is created there could be multiple items the customer is ordering. We should give the user the ability to add new items dynamically by clicking a button. The button will create a new response document and then reload the page. The repeat control will generate the following editable fields for all the response documents: Item Number, Price, and Quantity.
Here is a screen shot:
Want to read more? See John Mackey's blog