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.
It seems to be a problem with using XPages Full or Partial refresh.
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.
Below is the code with the remote service.
Any examples on how to affect or refresh the modal contents prior to showing the dialog would be appreciated.
<?xml version="1.0" encoding="UTF-8"?>
<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">
<xc:layout_Header></xc:layout_Header>
<xp:link escape="true" text="Link" id="link1" value="#myModal">
<xp:this.attrs>
<xp:attr name="role" value="button"></xp:attr>
<xp:attr name="data-toggle" value="modal"></xp:attr>
</xp:this.attrs>
</xp:link>
<xp:br></xp:br>
<xp:panel id="myPanel">
<xc:bs_Modal idName="myModal">
<xp:this.facets>
<xp:panel xp:key="facet_1">
My Dialog
<xp:br></xp:br>
<xp:br></xp:br>
Time
<xp:text escape="true" id="computedField1"
value="#{viewScope.vsTime}">
<xp:this.converter>
<xp:convertDateTime type="both"></xp:convertDateTime>
</xp:this.converter>
</xp:text>
</xp:panel>
</xp:this.facets>
</xc:bs_Modal>
</xp:panel>
<xp:br></xp:br>
<xe:jsonRpcService id="jsonRpcService1" serviceName="testService">
<xe:this.methods>
<xe:remoteMethod name="setTime">
<xe:this.script><![CDATA[viewScope.put("vsTime", @Now())]]></xe:this.script>
</xe:remoteMethod>
</xe:this.methods></xe:jsonRpcService>
<xp:br></xp:br>
<xp:scriptBlock id="scriptBlock1">
<xp:this.value><![CDATA[$('#myModal').on('show', function () {
testService.setTime();
var id = "#{id:myPanel}"
XSP.partialRefreshGet(id)
})]]></xp:this.value>
</xp:scriptBlock></xp:view>