title: Dynamically add custom control on Xpage
body: <p>how can I add custom control on the basis of sessionScope variable. I try include page container control but no luck:</p>
  
  <pre><code>&lt;xp:this.afterPageLoad&gt;&lt;![CDATA[#{javascript:sessionScope.put("viewName","ccViewAll.xsp");}]]&gt;&lt;/xp:this.afterPageLoad&gt;
  &lt;xp:text escape="true" id="computedField1"&gt;
      &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:sessionScope.get("viewName")}]]&gt;&lt;/xp:this.value&gt;
  &lt;/xp:text&gt;
  &lt;xc:appLayout&gt;
      &lt;xp:this.facets&gt;
          &lt;xp:panel xp:key="facetMiddle"&gt;
              &lt;xp:include id="include1"&gt;
                  &lt;xp:this.pageName&gt;&lt;![CDATA[${javascript:sessionScope.get("viewName")}]]&gt;
                  &lt;/xp:this.pageName&gt;
              &lt;/xp:include&gt;
          &lt;/xp:panel&gt;
      &lt;/xp:this.facets&gt;
  &lt;/xc:appLayout&gt;
  </code></pre>
  
  <p>The above code give me error Error 404 HTTP Web Server: Item Not Found Exception. But when I hardcode the viewname that is ccViewAll.xsp instead of sessionScope.get("viewName"), its work fine.</p>
  
  <p>-MAK</p>