The main task is to select one check box and get the index and set it in the edit box and proceed further,I am successful in achieving the selected index in edit box, but I want to allow the user to select only one date
After selecting one check box, I want to uncheck the other checked values,But in my code I can select the multiple check boxes and the recently checked value is getting stored in the edit box, I have tried with some client side JavaScript but failed , even the storing the checked index value in view scope method didn't helped me. the code with the check box in repeat control is below.
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.data>
<xp:dominoDocument var="document1" formName="testing">
</xp:dominoDocument>
</xp:this.data>
<xp:br></xp:br>
<xp:repeat id="repeat1" rows="30" var="r" indexVar="i" first="0">
<xp:this.value><![CDATA[#{javascript:var v:java.util.Vector = new java.util.Vector();
v.add('Date1');v.add('Date2');v.add('Date3');v.add('Date4');v.add('Date5');v.add('Date6');
return v;}]]></xp:this.value>
<xp:br></xp:br>
<xp:div id="checkDiv">
<xp:checkBox id="checkBox1">
<xp:eventHandler event="onchange" submit="true"
refreshMode="partial" refreshId="checkDiv">
<xp:this.action><![CDATA[#{javascript:if(getComponent("checkBox1").value == "true"){
//viewScope.put("IdValue",optionIndex2)
getComponent("finalDate").setValue(r);
//getComponent("checkBox1").getAttributes().put("true",optionIndex2);
}
else
getComponent("finalDate").setValue("");
}]]></xp:this.action>
</xp:eventHandler></xp:checkBox>
<xp:text escape="true" id="computedField1"
value="#{javascript:r}">
</xp:text>
</xp:div>
<xp:br></xp:br>
</xp:repeat>
<xp:inputText id="finalDate"></xp:inputText>
</xp:view>
I Don't know, checking it on client side would be optimal or on server side will be better.Need an idea how to keep only one check box checked. Any kind of suggestion would be helpful