title: XPages and Twitter Bootstrap Modal not working when using SSJS
body: <p>It's pretty easy to get a Twitter Bootstrap modal working in XPages just by following the examples in the site.  However, it doesn't seem to work if you want to use SSJS to affect the contents of the modal before it gets displayed.  It seems to flash, and often just shows the background.</p>
  
  <p>It seems to be a problem with using XPages Full or Partial refresh.</p>
  
  <p>I've tried getting it to work "normally" and I've tried using jQuery and a Remote Service to get the change in with no luck.</p>
  
  <p>Below is the code with the remote service.</p>
  
  <p>Any examples on how to affect or refresh the modal contents prior to showing the dialog would be appreciated.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xp:view xmlns:xp="http://www.ibm.com/xsp/core"
  xmlns:xc="http://www.ibm.com/xsp/custom"
  xmlns:xe="http://www.ibm.com/xsp/coreex"&gt;
  &lt;xc:layout_Header&gt;&lt;/xc:layout_Header&gt;
  &lt;xp:link escape="true" text="Link" id="link1" value="#myModal"&gt;
      &lt;xp:this.attrs&gt;
          &lt;xp:attr name="role" value="button"&gt;&lt;/xp:attr&gt;
          &lt;xp:attr name="data-toggle" value="modal"&gt;&lt;/xp:attr&gt;
      &lt;/xp:this.attrs&gt;
  
  &lt;/xp:link&gt;
  &lt;xp:br&gt;&lt;/xp:br&gt;
  
  &lt;xp:panel id="myPanel"&gt;
      &lt;xc:bs_Modal idName="myModal"&gt;
          &lt;xp:this.facets&gt;
              &lt;xp:panel xp:key="facet_1"&gt;
                  My Dialog
                  &lt;xp:br&gt;&lt;/xp:br&gt;
                  &lt;xp:br&gt;&lt;/xp:br&gt;
                  Time
  
  
  
                  &lt;xp:text escape="true" id="computedField1"
                      value="#{viewScope.vsTime}"&gt;
                      &lt;xp:this.converter&gt;
                          &lt;xp:convertDateTime type="both"&gt;&lt;/xp:convertDateTime&gt;
                      &lt;/xp:this.converter&gt;
                  &lt;/xp:text&gt;
              &lt;/xp:panel&gt;
          &lt;/xp:this.facets&gt;
      &lt;/xc:bs_Modal&gt;
  &lt;/xp:panel&gt;
  &lt;xp:br&gt;&lt;/xp:br&gt;
  
  
  &lt;xe:jsonRpcService id="jsonRpcService1" serviceName="testService"&gt;
      &lt;xe:this.methods&gt;
          &lt;xe:remoteMethod name="setTime"&gt;
              &lt;xe:this.script&gt;&lt;![CDATA[viewScope.put("vsTime", @Now())]]&gt;&lt;/xe:this.script&gt;
          &lt;/xe:remoteMethod&gt;
      &lt;/xe:this.methods&gt;&lt;/xe:jsonRpcService&gt;
  &lt;xp:br&gt;&lt;/xp:br&gt;
  &lt;xp:scriptBlock id="scriptBlock1"&gt;
      &lt;xp:this.value&gt;&lt;![CDATA[$('#myModal').on('show', function () {
  testService.setTime();
  var id =  "#{id:myPanel}"
  XSP.partialRefreshGet(id)
  })]]&gt;&lt;/xp:this.value&gt;
  &lt;/xp:scriptBlock&gt;&lt;/xp:view&gt;
  </code></pre>