-
1. Re: HtmlAjaxSupport for HtmlSelectBooleanCheckbox
harut Apr 30, 2010 6:50 AM (in response to kapil29)Hi, here is similar code which works fine:
...................
HtmlSelectBooleanCheckbox checkbox = new HtmlSelectBooleanCheckbox();
ValueExpression ve = createValueExpression(context, control.getIndex(), EDIT_ELEMENT_CHECK_BOX_TYPE);
checkbox.setValueExpression("value", ve);HtmlAjaxSupport mySupport = new HtmlAjaxSupport();
mySupport.setEvent("onclick");
mySupport.setReRender(AjaxRendererUtils.asSet("dynamicPart"));
mySupport.setAjaxSingle(false);
checkbox.getFacets().put("a4jsupport", mySupport);................................
private ValueExpression createValueExpression(FacesContext pContext,
int index, int checkboxType) {String expression = "#{parser.allControls.controlTypes[" + index + "].controlValue}";
if (checkboxType == CHECK_BOX_TYPE) {
expression = "#{parser.allControls.controlTypes[" + index + "].booleanValue}";
} else if (checkboxType == EDIT_ELEMENT_CHECK_BOX_TYPE) {
expression = "#{parser.allControls.controlTypes[" + index + "].enabled}";
}ValueExpression ve = mFactory.createValueExpression(pContext.getELContext(), expression, String.class);
return ve;
}
-
2. Re: HtmlAjaxSupport for HtmlSelectBooleanCheckbox
kapil29 May 3, 2010 2:21 AM (in response to harut)Thanks Its work for me...