I have the latest extension library installed running on the latest version of Domino. I am using a simple listBox with values from a DBColumn ( which works to populate the listBox ).
However, I can't seem to get the selected value of the listBox. I've poked around the net a while and found several different things which I have tried unsuccessfully. Then I started reading about having to install other libraries etc. Now I am confused. Below is my code. All I want to do is get the selected value from the listBox once it changes but I really want to use the select2 features to search the listBox. Can someone point me in the right direction on how to get the selected value when it changes?
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:bx="http://www.openntf.org/xsp/bootstrap">
<xp:scriptBlock id="scriptBlock2">
<xp:this.value>
<![CDATA[
$(document).ready(
function() { x$( "#{id:listBoxProperties}" ).select2()
.on("change", function(e) { XSP.partialRefreshPost(
"#{id:computedField2}" );
}
}
);
]]>
</xp:this.value>
</xp:scriptBlock>
<xp:panel>
<xp:listBox id="listBoxProperties" value="#{viewScope.selectedProperty}"
style="width:250px">
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:listOfProperties = @DbColumn( @DbName(), 'vwAuditDocsByPropertyNo', 1 );
if( @IsError( listOfProperties ) )
"Error looking up properties: " + listOfProperties;
listOfProperties;
}]]></xp:this.value>
</xp:selectItems>
<xp:eventHandler event="onchange" submit="true"
refreshMode="complete">
</xp:eventHandler></xp:listBox>
<bx:select2PickerCombo id="select2Property"
for="listBoxProperties" placeHolder="-Select a Property-"
binding="#{javascript:viewScope.selectedProperty}">
</bx:select2PickerCombo>
<xp:br></xp:br>
<xp:text escape="true" id="computedField1"
value="#{javascript:viewScope.selectedProperty;}">
</xp:text>
<xp:text escape="true" id="computedField2">
<xp:this.value><![CDATA[#{javascript:getComponent( "listBoxProperties").getValue()}]]></xp:this.value>
</xp:text>
</xp:panel>
</xp:view>