Javascript for document selection in XPage Data Table - remember to refresh view!
Rune Hegge 26 February 2010 11:37:24
Data tables in XPages are powerful controls for repeating document information from for example a view. You may even use javascript to make an advanced "search" or "query" for the documents you would like to list. To do this you select the "Javascript" iteration option for the Data Table. To make a selection you may for example use the getAllDocumentsByKey() method of the NotesView javascript class. This method returns a NotesDocumentCollection object that will be used to populate the Data Table.On "static data" this will work just fine. However, if you currently are creating or editing a document with your XPage, and on that same XPage you have a Data Table that should reflect any document changes you may submit (assuming that the submit button also updates the data table), you will need one more line of javascript to make the magic work. Before calling the getAllDocumentsByKey() method, perform a refresh() on the NotesView object:
This way you will see your changes within the Data Table immediately after the submission. If you omit this line of code, you may see that the Data Table still is updated, but that it always is one step behind of your submissions.
Comments Disabled
