Your code is working fine for me. Try adding a4j:log and see if there are any errors/warnings.
Thaks for reply.
I added a4j:log, but I see no errors in the log.
But what I see is that in the response my components to rerender are not mentioned:
<meta name="Ajax-Update-Ids" content="aform:input1_message,aform:input2_message" />
These are only the rich:message components on the form, but the aform:input2 and aform:combo2 are missing from this list wich are added to the HtmlAjaxSupport component's rerender property.
I used 3.2.1-SNAPSHOT and also tried with 3.2.2-CR3, same result with both.
This is my actual code:
((UIInput) component).addValueChangeListener(newGenericValueChangeListener()); ((UIInput) component).getAttributes().put("valuechangelistener", attr_type + ";" + value); HtmlAjaxSupport onchange = new HtmlAjaxSupport(); onchange.setAjaxSingle(true); onchange.setEvent("onchange"); onchange.setReRender("aform:input2"); // here I use the "value" variable wich contains in this case: "aform:input2,aform:combo2" , but not working with a constant like above either. ((UIInput) component).getFacets().put("a4jsupport", onchange);
The component variable is UIComponent type, and all objects are created dynamically in the constructor of the bean from an XML file, and then added to the viewroot.
I made a lot of experiments, and I got the following results:
- Event property is working flawlessly, I tried it with onchange, and onmouseover, both event was fired, also seen in the a4j:log
- ReRender property is NOT working, the components are never rerendered given in this property
So somehow a part of the HtmlAjaxSupport component is working, and part of it does not.
I do not have a clue, why.
Ok, finally I got it work, and found the problem:
HtmlSelectOneListbox box = new HtmlSelectOneListbox(); box.setId("combo1"); HtmlAjaxSupport onchange = new HtmlAjaxSupport(); onchange.setAjaxSingle(true); onchange.setEvent("onchange"); onchange.setId("a4jsupport"); onchange.setReRender("input2, combo2"); box.getFacets().put("a4jsupport", onchange); parent.getChildren().add(box);
The solution was to set the HtmlAjaxSupport's Id to that string, wich string you provide for the facet name.
So the reRender property is also working...
So this is good info I think for all !!