Martin Perrie
Martin Perrie

Reputation: 410

XPages checkboxgroup and jQuery Mobile

If I use a checkboxgroup with jQuery Mobile I get some strange UI generated. I thought I might workaround this by using a single checkbox inside a repeat control. I can get the UI to display correctly using this method and the repeat is bound to a view that I can use to generate the labels for each of the check boxes.

But I'm not sure how I should handle the data server side or what I should bind the check boxes to. Ultimately the selected values should be stored in a single, multi-value field on the Notes document. If I bind to this field on the document, then it just gets the value of the last checkbox - which makes sense.

Alternatively....is there some sort of fix to get the checkboxgroup to display correctly.

Have had this problem for a while...but it is now becoming a more urgent issue... so any suggestions much appreciated.

Upvotes: 1

Views: 661

Answers (1)

MarkyRoden
MarkyRoden

Reputation: 1074

Martin - checkboxgroups suck in general. I suggest you use individual checkboxes and compute your desired answer on the back end. No issues with individual checkboxes

<xp:checkBox id="checkBox1" value="#{invite.Marketing}">
</xp:checkBox>
<xp:label value="Marketing" id="label4" for="checkBox1"
        style="font-weight:bold">
</xp:label>
<xp:checkBox id="checkBox2" value="#{invite.Tracking}">
</xp:checkBox>
<xp:label value="Tracking" id="label3" for="checkBox2"
        style="font-weight:bold">
</xp:label>

Upvotes: 1

Related Questions