Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>NOTE:</strong> I'm guessing you know why adding a panel fixes the problem, but I'm including additional detail for the benefit of others who might encounter the same behavior.</p> <p>Almost everything in XPages is processed hierarchically. So variables, data sources, and component references are often only valid within the context of a container.</p> <p>Given the source code you listed in your question, the data source is attached to the "view root", so it's valid anywhere on that page (or Custom Control). As the page is evaluated at runtime, the root component will be processed first, and part of that evaluation is determining whether the data source attached to it needs to be created or already exists, based on its scope.</p> <p>Once that's finished, it can start processing any child components, which -- again, in your example -- includes the <code>jdbcConnectionManager</code>.</p> <p>This is why, as Panu mentioned, the data source can't refer to the component: it's attached to a parent.</p> <p>But data sources can be associated with specific panels, not just view roots. If you add a <code>panel</code> as a sibling to the <code>jdbcConnectionManager</code> -- specifically, <em>below</em> it -- and move the data source to that <code>panel</code>, here's what then happens at runtime:</p> <ul> <li>Domino starts processing the view root; not much to do here now, so it just hands off control to its children.</li> <li>The first child is the <code>jdbcConnectionManager</code>, so whatever encoding needs to happen for that component occurs before dealing with the rest.</li> <li>Next, the panel is evaluated. This includes evaluating the data source, which can now refer to the connection manager component, since it has already been loaded.</li> <li>Finally, all of the panel's descendant components (its children, their children, and so on) are evaluated. So anything that needs to refer to the data source does need to be defined somewhere inside this panel, but the data source can refer to the connection manager without blowing up specifically because that component <em>isn't</em> inside the panel... it's already been processed by the time the panel is dealt with.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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