XPages - Radio Group onChange featurette

It is my experience that the onChange event of the RadioGroup (and CheckboxGroup) fire when the page loads. Surely this can’t be correct? Or am I missunderstanding the point of the onChange event?

Example code - check the server log and you’ll see that the onChange event fires 3 times each for radio and checkbox controls:-

xp:this.data

<xp:dominoDocument var="document1"

formName="ApplicationProfile">

</xp:dominoDocument>

</xp:this.data>

<xp:radioGroup id="radioGroup1" layout="pageDirection"

	value="#{document1.MIPStatus}">

	<xp:this.onchange><![CDATA[#{javascript:print( "radioGroup1 onChange has fired" );}]]></xp:this.onchange>

	<xp:selectItem itemLabel="option1"

	itemValue="Bulk" id="selectItem1">

	</xp:selectItem>

	<xp:selectItem itemLabel="option2"

		itemValue="Retail" id="selectItem2">

	</xp:selectItem>

	<xp:selectItem

		itemLabel="option3" itemValue="Both"

		id="selectItem3">

	</xp:selectItem>

</xp:radioGroup>

<xp:br></xp:br>

<xp:checkBoxGroup id="checkBoxGroup1"

	value="#{document1.MIPStatus}">

	<xp:this.onchange><![CDATA[#{javascript:print( "checkBoxGroup1 onChange has fired" );}]]></xp:this.onchange>

	<xp:selectItem itemLabel="option1"

		itemValue="Bulk" id="selectItem4">

	</xp:selectItem>

	<xp:selectItem itemLabel="option2"

		itemValue="Retail" id="selectItem5">

	</xp:selectItem>

	<xp:selectItem

		itemLabel="option3" itemValue="Both"

		id="selectItem6">

	</xp:selectItem></xp:checkBoxGroup>

Subject: No!!! not solution for Radio & Checkbox Groups

Now the onchange event doesn’t fire at all for Radio or Checkbox Groups.

Help!

Subject: Wondered if it isDataBeingLoaded would help

context.isDataBeingLoaded() is false when these onChange events fire. How the blazes am I supposed to spot if any field is changed without keeping a record of every field value? Painful.

Subject: Aha! Designer bug perhaps? One for Lotus to look at!

I entered the SSJS code into the “events - onchange” of the control’s All Properties. Interestingly, that code does NOT show up in the “Select & Change - onchange” on the “Events” Eclipse View!

If I remove it and then enter the same code into the “Select & Change” Script Editor on the Events Eclipse View, then it does appear in the All Properties. And executes when I would expect. Phew!

resultant Source XML from entering code into “Select & Change” :-

<xp:eventHandler event=“onchange” submit=“true”

refreshMode="complete">

xp:this.action</xp:this.action>

</xp:eventHandler>