1
votes

I'm asked to create multiple <xp:checkbox> controls all of them need to be bound to the same Domino data field. If this was an ordinary case I would use a <xp:checkBoxGroup> control, but here the checkboxes need to be spread all over the page. I.e.: there will be <xp:panel> controls between the various <xp:checkbox> instances.
So if user selects say the first of three checkboxes the resulting Domino field will contain the value "false" if the "uncheckValue" property is left empty, since the last checkbox in line obviously overwrites the values of the previous ones. Only if users check the last box the field will contain a suitable value.
In "normal" html code the various checkboxes simply are connected using the "name" attribute. But in Xpages that attribute is already used and overwritten by the engine duplicating the dynamic control id.

Q: is there some type of "native" solution apart from "hacking" the checkboxes' onchange events copying the checked values into a hidden field control?

1

1 Answers

2
votes

There are a couple ways you can go about this. For me, the easiest is to bind the three checkboxes to three separate fields, then compute the field on the underlying form that needs to contain the appropriate value.

You can compute it a few ways: - Turn on compute on save on the document data source - Compute it manually in your business logic during the document save

The reason why I prefer this method is to make sure the checkboxes contain the correct value when the document is being opened.