I've created a custom control that is basically a checkbox. I want the checkbox read the value of the dataSource I pass in - which would be a managed bean. I can get the checkbox field to read from the bean but I'm not seeing anything happen when I change the checkbox. It doesn't look like the setter in the bean ever gets called.
The key snippets of my bean are:
private boolean categoriesOn;
...
public boolean isCategoriesOn() {
System.out.println("Getting On Value");
return categoriesOn;
}
public void setCategoriesOn(boolean newValue) {
System.out.println("Setting On : " + newValue);
this.categoriesOn = newValue;
}
The control on the XPage looks like this:
<xp:checkBox id="flipSwitch"
styleClass="onoffswitch-checkbox"
value="${compositeData.dataSource}"
checkedValue="#{javascript:true}"
uncheckedValue="#{javascript:false}">
<xp:eventHandler event="onchange" submit="true"
refreshMode="complete">
</xp:eventHandler>
</xp:checkBox>
I pass the bean to the custom control with a custom property:
<xc:crtl_toggleSwitch
dataSource="#{exhibitorInfo.categoriesOn}"
refreshID="computedField6">
</xc:crtl_toggleSwitch>
dataSource is set to use Methodbinding.
I've tried with partial and full refresh. I'm just not sure what I need to do to get the changed value back into the bean.
thanks for any advice.