Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Because <code>action</code> is set to <code>createDocument</code> (which you could omit, since that's the default value), this causes a new document to be created in memory. This is why the document is in edit mode: you're composing a new record. If you don't want to create a new document, then change the <code>action</code> attribute to one of the other options: <code>openDocument</code> or <code>editDocument</code>. Either of these require that the <code>documentId</code> attribute be set as well, because the data source needs to know <em>which</em> document you wish to, respectively, open or edit.</p> <p>If you omit the <code>ignoreRequestParams</code> attribute, then this data source <em>doesn't</em> ignore the URL request parameters. Instead, it looks for parameters named <code>databaseName</code>, <code>formName</code>, <code>documentId</code>, and <code>action</code>. If any of these parameters are included in the URL, the value of each overrides what is defined on the data source. This is why if you open an instance of <code>document1</code>, but don't set <code>ignoreRequestParams</code> on <code>document2</code>, then <em>both</em> documents will have the same mode (read/edit): because <em>neither</em> data source is ignoring the URL, so <em>both</em> data sources are doing what the URL is telling them to.</p> <p>Generally, when defining multiple data sources on the same XPage, you'll have one that can be considered the "primary" data source; any other data has some relationship to that data, but the primary data is the user's context for viewing all the data on that page. So you <strong>want</strong> that data source to respect URL parameters to allow navigation (from a Data View, View Panel, Repeat, etc.) to be able to indicate which document is being opened, and in what mode. But all data sources <em>related</em> to that document should explicitly specify what data they're bound to, and the action being taken on that data, and use <code>ignoreRequestParams</code> to ensure that the URL doesn't override this information.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload